Skip to content

Warn on redundant / needless type annotations #9155

Closed
@shepmaster

Description

@shepmaster

What it does

Warns about needless / redundant type annotations.

Lint Name

redundant_type_annotation

Category

style, pedantic

Advantage

Code is more idiomatic, shorter, and easier to modify.

Drawbacks

Types may be added by some novice Rust developers as hints to help remember what type is present.

Example

let foo: String = String::new();

Could be written as:

let foo = String::new();

Metadata

Metadata

Assignees

Labels

A-lintArea: New lintsL-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