//! Custom Askama filters.

/// Returns `singular` if `count == 1`, otherwise `plural`.
#[allow(
    dead_code,
    clippy::trivially_copy_pass_by_ref,
    clippy::unnecessary_wraps
)]
pub fn pluralize(count: &usize, singular: &str, plural: &str) -> askama::Result<String> {
    Ok(if *count == 1 {
        singular.to_string()
    } else {
        plural.to_string()
    })
}
