MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / format_count

Function format_count

atomic-cli/src/commands/add.rs:545–551  ·  view source on GitHub ↗

Format a count with singular/plural noun.

(count: usize, singular: &str, plural: &str)

Source from the content-addressed store, hash-verified

543
544/// Format a count with singular/plural noun.
545fn format_count(count: usize, singular: &str, plural: &str) -> String {
546 if count == 1 {
547 format!("{} {}", count, singular)
548 } else {
549 format!("{} {}", count, plural)
550 }
551}
552
553// Tests
554

Callers 1

print_resultsMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected