Skip to content

Normalize asserts #6999

Closed
Closed
@tschuett

Description

@tschuett

What it does

Improves readability

Categories (optional)

What is the advantage of the recommended code over the original code

For example:

  • Remove bounce checking inserted by ...
  • Remove the need to duplicating/storing/typo ...

Drawbacks

None.

Example

assert!(result.len() == self.data.len());
assert!(result.len() != self.data.len());

Could be written as:

assert_eq!(result.len(), self.data.len());
assert_ne!(result.len(), self.data.len());

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: New lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions