Format a count with auto-pluralization (appends 's'). Convenience wrapper around [`format_count`] for regular English nouns where the plural is just the singular + 's'. # Arguments `count` - The count `singular` - The singular form of the noun (plural = singular + "s") # Example ```rust,ignore assert_eq!(format_count_auto(1, "change"), "1 change"); assert_eq!(format_count_auto(5, "change"), "
(count: usize, singular: &str)
| 714 | /// assert_eq!(format_count_auto(5, "change"), "5 changes"); |
| 715 | /// ``` |
| 716 | pub fn format_count_auto(count: usize, singular: &str) -> String { |
| 717 | if count == 1 { |
| 718 | format!("1 {}", singular) |
| 719 | } else { |
| 720 | format!("{} {}s", count, singular) |
| 721 | } |
| 722 | } |
| 723 | |
| 724 | // Tests |
| 725 |
nothing calls this directly
no outgoing calls
no test coverage detected