Format a count with proper pluralization. # Arguments `count` - The number of items `singular` - The singular form of the word (e.g., "change") # Returns A string like "1 change" or "5 changes". # Example ```rust use atomic::commands::clone::helpers::format_count; assert_eq!(format_count(0, "change"), "0 changes"); assert_eq!(format_count(1, "change"), "1 change"); assert_eq!(format_count(5
(count: usize, singular: &str)
| 617 | /// assert_eq!(format_count(5, "change"), "5 changes"); |
| 618 | /// ``` |
| 619 | pub fn format_count(count: usize, singular: &str) -> String { |
| 620 | if count == 1 { |
| 621 | format!("{} {}", count, singular) |
| 622 | } else { |
| 623 | format!("{} {}s", count, singular) |
| 624 | } |
| 625 | } |
| 626 | |
| 627 | /// Format bytes in a human-readable way. |
| 628 | /// |
nothing calls this directly
no outgoing calls
no test coverage detected