-
Notifications
You must be signed in to change notification settings - Fork 16
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
changed BUFFER_SIZE to usize (cf. #49) #52
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0ca046c
changed BUFFER_SIZE to usize (cf. #49)
b-ma c78f69c
derive `BUFFER_SIZE: usize` from `BUFFER_SIZE_U32: u32`
b-ma 76a1e43
removed clippy errors
b-ma 370a0d5
increased ulps to make test pass
b-ma d3578ca
cleaner assertion
b-ma f989c3f
cast BUFFER_SIZE to u32 when needed
b-ma File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
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.
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.
Suggestions:
BUFFER_SIZE
withBUFFER_SIZE_USIZE
to make explicit that there is severalBUFFER_SIZE_*
variables, even whenusize
type is used.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.
My (not really opinionated) rationale here was that as
BUFFER_SIZE_U32
is finally only used in low-levelio.rs
, maybe it's good to reinforce that it is a kind of "special"const
compared toBUFFER_SIZE
(which should be preferred).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 also prefer
BUFFER_SIZE
as a succinct name, conforming nicely to the spec naming.If the U32 variant is only used in io.rs, let's move the const there so it will not pollute the pub namespace.
You could even use the usize variant in that file, and only cast at the final moment when passsing it to cpal. In that case we don't even need a const
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.
ok, used
u32::try_from(u: usize)
at last moment and clippy doesn't complain