Skip to content

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

Closed
@LunaBorowska

Description

@LunaBorowska

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);
}

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