1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-25 04:24:20 +00:00
royalnet/src/utils/italian.rs

12 lines
277 B
Rust
Raw Normal View History

use std::ops::Add;
pub fn countable_noun_suffix<T, U>(count: T, singular: &'static str, plural: &'static str)
-> &'static str
where
T: Default + Add<usize, Output=U> + PartialEq<U>,
{
match count == (T::default() + 1) {
true => singular,
false => plural,
}
}