We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently for the following function
fn foo(a: i32, b: i32) -> i32 { a / b }
it always checks first that b is not zero. It's an unnecessary extra cost when people can logically ensure that the divisor would never be zero.
b
It would probably be ideal if one can write
fn foo(a: i32, b: NonZeroI32) -> i32 { a / b }
and it doesn't do zero-checking.
The text was updated successfully, but these errors were encountered:
You need b.get(). This seems a dupe of #54868
Sorry, something went wrong.
Yeah, looks like a dupe. Thanks.
No branches or pull requests
Currently for the following function
it always checks first that
b
is not zero. It's an unnecessary extra cost when people can logically ensure that the divisor would never be zero.It would probably be ideal if one can write
and it doesn't do zero-checking.
The text was updated successfully, but these errors were encountered: