Skip to content

plural s #2

@colin-kiegel

Description

@colin-kiegel

I just read your intersting blog post and stumbled upon the plural s logic in your example.

I think there is a general problem and an easy solution:

  • not all languages have a plural s, e.g. the German plural of meter is meter.
  • even in the English language there are irregular words. The plural of foot is feet and the plural of Celsius is Celsius :-)

In other words the FooUnit traits should have a singular_name() and plural_name() method. Also the return type could be changed to &'static str to reflect the fact that it is a constant and avoid the heap allocation of String.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions