Skip to content

Normalize module names containing multiple objects #155

@josecelano

Description

@josecelano

Sometimes single-file and folder module names containing more than one public struct are singular and sometimes plural.

For example:

  • src/http/request.rs contains more than one request type.
  • src/http/response.rs contains more than one response type.

In general, the plural is the most used option.

The folder name in the plural is better because it contains a collection of that "thing", but sometimes, when you use the namespace, the singular is easier to read, for example:

  • request::Announce instead of requests::Announce.

Another advantage of the plural is you do not get Clippy warnings when a function in the module has a suffix which is the mod name, For example, mod handlers and an xxx_handler function inside.

I prefer the plural.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions