gbdev / rgbobj

A Rust program for humans to inspect RGBDS object files
MIT License
5 stars 1 forks source link

Correctly pluralize "bytes", "patches", etc #5

Closed Rangi42 closed 5 months ago

Rangi42 commented 5 months ago

Perhaps this could be factored out into a struct Plural(&'static str, usize); ...and then println!("{len} patch{}", Plural("es", len)).

This would require casting a couple of sites, e.g. Plural("s", len as usize). It would also not be a fully-general pluralization support, e.g. println!("{} loa{}", len, if len == 1 { "f" } else { "ves" }) wouldn't work. So I think it's on the borderline of being a too-abstract solution for the given problem.