Skip to content

Commit

Permalink
use usize::min function
Browse files Browse the repository at this point in the history
  • Loading branch information
yggverse committed Dec 18, 2024
1 parent 97ba2aa commit 37da5d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ pub fn ns<'a>(n: usize, s: &[&'a str]) -> &'a str {
s[if (n % 100) > 4 && (n % 100) < 20 {
2
} else {
[2, 0, 1, 1, 1, 2][std::cmp::min(n % 10, 5)]
[2, 0, 1, 1, 1, 2][usize::min(n % 10, 5)]
}]
}

0 comments on commit 37da5d5

Please sign in to comment.