[ruff] Unnecessary cast to int (RUF046) (#14697)

## Summary

Resolves #11412.

## Test Plan

`cargo nextest run` and `cargo insta test`.

---------

Co-authored-by: Micha Reiser <micha@reiser.io>
This commit is contained in:
InSync 2024-12-05 16:30:06 +07:00 committed by GitHub
parent 2d3f557875
commit fda8b1f884
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 672 additions and 1 deletions

View file

@ -96,7 +96,7 @@ impl Int {
}
}
/// Return the [`Int`] as an u64, if it can be represented as that data type.
/// Return the [`Int`] as an usize, if it can be represented as that data type.
pub fn as_usize(&self) -> Option<usize> {
match &self.0 {
Number::Small(small) => usize::try_from(*small).ok(),