Skip to content

new lint: passing 0 as length to Vec::resize #5444

Description

@sugar700

Clippy should inform about passing 0 as length to resize. It's not useful, and it's likely a mistake caused by swapping the parameter order.

Example code:

fn main() {
    let mut v = Vec::new();
    v.resize(0, 1024);
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: New lintsL-correctnessLint: Belongs in the correctness lint groupL-suggestionLint: Improving, adding or fixing lint suggestionsgood 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