is_singular_of

Function is_singular_of 

Source
pub fn is_singular_of(singular: &str, plural: &str) -> bool
Expand description

Check if a singular word could be the singular form of a plural word.

This is useful for matching node names to field names in deserialization:

  • is_singular_of("dependency", "dependencies")true
  • is_singular_of("child", "children")true
  • is_singular_of("item", "items")true

This function is allocation-free when possible.