Struct branchless::core::formatting::Pluralize [−][src]
Expand description
Pluralize a quantity, as appropriate. Example:
let p = Pluralize { amount: 1, singular: "thing", plural: "things"}; assert_eq!(p.to_string(), "1 thing"); let p = Pluralize { amount: 2, singular: "thing", plural: "things"}; assert_eq!(p.to_string(), "2 things");
Fields
amount: isize
The amount of the quantity.
singular: &'a str
The string to render if the amount is singular.
plural: &'a str
The string to render if the amount is plural.uee
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for Pluralize<'a>
impl<'a> UnwindSafe for Pluralize<'a>