Conversation
src/main.rs
Outdated
Collaborator
There was a problem hiding this comment.
if this really works, then that's amazing
Collaborator
|
@mlodato517 since I would never remember this, maybe a comment that "this does a saturating cast" would be helpful |
e2ffdbc to
3b157ff
Compare
**This Commit** Just fixes two small `clippy` lints. **Note** When handling one of the `clippy` lints (unnecessary `return`) I took a look at `f32_to_i16` and it looked to me like this was doing a saturating cast. If that's the case then, after [doing some research][0], it looks like `as` [already does saturating casts][1]! [0]: rust-lang/rust#71269 [1]: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=1348ce2173e812ff4199446a4fed5a99
3b157ff to
12775ea
Compare
Contributor
Author
|
Good idea - did that! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This Commit
Just fixes two small
clippylints.Note
When handling one of the
clippylints (unnecessaryreturn) I took alook at
f32_to_i16and it looked to me like this was doing asaturating cast. If that's the case then, after doing some
research, it looks like
asalready does saturating casts!