Skip to content
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

Build builder with 'build' instead of TryInto #592

Merged
merged 1 commit into from
Nov 22, 2023
Merged

Build builder with 'build' instead of TryInto #592

merged 1 commit into from
Nov 22, 2023

Conversation

cmyr
Copy link
Member

@cmyr cmyr commented Nov 21, 2023

This is a little bit of cleanup to be more consistent in our (non)use of TryInto.

No functional change, JMM

This is a little bit of cleanup to be more consistent in our (non)use of
TryInto.
@rsheeter
Copy link
Contributor

This seems like a fairly reasonable use of TryInto, I'm not entirely sure why it needs to be fixed?

Copy link
Contributor

@rsheeter rsheeter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't find it obvious this is an improvement but I don't particularly object either.

@cmyr
Copy link
Member Author

cmyr commented Nov 21, 2023

Yea, this is mostly about semantics and Rust idiom. I think this has come up before, but TryFrom is specifically about conversions between types that may fail in specific, controlled circumstances. The docs do a better job than I of explaining: http://doc.rust-lang.org/1.72.1/std/convert/trait.TryFrom.html

@cmyr cmyr added this pull request to the merge queue Nov 22, 2023
Merged via the queue into main with commit 5b9f99f Nov 22, 2023
10 checks passed
@cmyr cmyr deleted the less-tryinto branch November 22, 2023 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants