rust-lang/rust-clippy

Lint for unused empty function value

Offen

#15.957 geöffnet am 26.10.2025

 (10 Kommentare) (0 Reaktionen) (1 zugewiesene Person)Rust (1.391 Forks)batch import
C-bugI-false-negativegood first issue

Repository-Metriken

Stars
 (10.406 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 19T 22h) (113 gemergte PRs in 30 T)

Beschreibung

What it does

Suggests turning let _unused = returns_nothing(); to returns_nothing();

Advantage

Increases code hygiene

Drawbacks

None

Example

let _unused: () = returns_nothing();

Could be written as:

returns_nothing();

Comparison with existing lints

No similar lints were found

Additional Context

A quick Github search shows around 116 thousand instances of the aforementioned example

Contributor Guide