Monday, December 26, 2022

Rust pop-quiz on Boxing Day: plurality

Rust pop-quiz on Boxing Day


"1 trade"

You've seen it a million times if you've seen it once: "1 trades".

It's like programmers don't know how to write the `plural`-function.

Write the plural-function:

plural(1, "trade") == "1 trade"
plural(327, "trade") == "327 trades"

No comments:

Post a Comment