duck-diagnostic 0.3.0

Generic diagnostic engine for building rich error reporting into any tool
Documentation
1
2
3
4
5
6
7
8
9
10
pub fn pluralize(word: &str, count: usize) -> &str {
  if count == 1 {
    return word;
  }
  match word {
    "error" => "errors",
    "warning" => "warnings",
    _ => word,
  }
}