Skip to content

Encourage fixed-size integer #16446

Description

@l0kod

The #6023 force to use a type suffix for integers. As discussed in rust-lang/rfcs#115 and #9940, the int and uint should only be used for memory-related values (e.g. length).

The documentations mostly use i suffix examples. It should encourage the use of fixed-size integer (e.g. u32) for common uses.

A more strict rule could be to remove the u and i from allowed suffixes, but to rely on full explicit typing (e.g. : int) when really needed.
This could be annoying for range-like functions but it's not that burdensome to use the explicit generic typing (e.g. range::<uint>(0, 5)).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions