Skip to content

New lint: replace x.get(x.len()-1) with x.last() #3673

Closed
@detrumi

Description

@detrumi

The following can be replaced with x.last():

let x = vec![1,2,3];
let _ = x.get(x.len() - 1);

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: New lintsL-complexityLint: Belongs in the complexity lint groupgood first issueThese issues are a good way to get started with Clippy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions