Fix clippy errors

This commit is contained in:
unvalley
2022-11-04 09:27:46 +09:00
parent b09676779d
commit abf1cf9cd5
3 changed files with 7 additions and 9 deletions

View File

@ -36,7 +36,7 @@ impl<'t, 'u, 'i> WordsPrefixesFst<'t, 'u, 'i> {
/// Default value is `4` bytes. This value must be between 1 and 25 will be clamped
/// to these bounds, otherwise.
pub fn max_prefix_length(&mut self, value: usize) -> &mut Self {
self.max_prefix_length = value.min(25).max(1); // clamp [1, 25]
self.max_prefix_length = value.clamp(1, 25);
self
}