windows-rs icon indicating copy to clipboard operation
windows-rs copied to clipboard

ID3D11DeviceContext::RSGetState returns a Result<>, should be an Option<>

Open rokbok opened this issue 1 year ago • 1 comments

Summary

ID3D11DeviceContext::RSGetState returns a Result<>. However, according to the docs, this function cannot fail. So I assume an error is returned when the C++ function returns null. This is a bit misleading, because nothing went wrong. The function should return None instead in this case

Crate manifest

No response

Crate code

No response

rokbok avatar Feb 19 '24 14:02 rokbok

I've been torn about whether this should be fixed or whether this is more consistent the way it is. Since many/most APIs return a COM interface using Result<T>, it would make this API different without a compelling reason to be different.

kennykerr avatar Aug 29 '24 13:08 kennykerr