Skip to content

New lint: Use shorthand constructors #730

@TimJentzsch

Description

@TimJentzsch

What problem does this solve or what need does it fill?

Enforce consistency across the code-base, make the code easier to read.

What solution would you like?

Enforce the usage of some shorthand functions that Bevy provides.

Examples:

  • Val::Px(3.0) -> px(3)
  • Val::Percent(100.0) -> percent(100)
  • ..Default::default() -> ..default()

What alternative(s) have you considered?

--

Additional context

This is also inconsistent in the Bevy repository, see bevyengine/bevy#22753

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LinterRelated to the linter and custom lintsC-FeatureMake something new possible

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions