-
-
Notifications
You must be signed in to change notification settings - Fork 887
add some nullable ref types for image detection #2275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Definitely the best approach. |
|
|
||
| /// <inheritdoc/> | ||
| public IImageFormat DetectFormat(ReadOnlySpan<byte> header) | ||
| public IImageFormat? DetectFormat(ReadOnlySpan<byte> header) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot decide what the best pattern for nullable return types should be. I feel like anything that returns a nullable type should probably use a TryXX(in, out..) pattern (though I still haven't found a nice async pattern for that)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like anything that returns a nullable type should probably use a TryXX(in, out..)
yeah. i was trying to do this in the least intrusive way
though I still haven't found a nice async pattern for that
neither have I
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
happy to add some TryXX overloads. but i would prefer to do those in a new PR
|
Assuming we are 100% committed to finish #2231 for 3.0, we need to decide about the global strategy we want to take to refactor the entire API. The PR doesn't fit the approach recommended by @tocsoft's #2231 (comment) (changes a small-sub area without without step 1). |
|
note that the tryxxx conversation should not be happening on this pr |
|
Thanks for this @SimonCropp and apologies for the slow response. I'm gonna close this in favour of the more general #2282 which allows us to complete step 1 of the global approach. Thanks again |
|
@JimBobSquarePants no worries at all |
My plan it to tackle this as small easily reviewable PRs
given the Big Bang #2236 didnt seem to work