Parent [>]
1//! Custom Askama filters.
2
3/// Returns `singular` if `count == 1`, otherwise `plural`.
4#[allow(
5    dead_code,
6    clippy::trivially_copy_pass_by_ref,
7    clippy::unnecessary_wraps
8)]
9pub fn pluralize(count: &usize, singular: &str, plural: &str) -> askama::Result<String> {
10    Ok(if *count == 1 {
11        singular.to_string()
12    } else {
13        plural.to_string()
14    })
15}