rust-lang/rust-clippy

Lint for unused empty function value

Open

#15,957 建立於 2025年10月26日

在 GitHub 查看
 (10 留言) (0 反應) (1 負責人)Rust (10,406 star) (1,391 fork)batch import
C-bugI-false-negativegood first issue

描述

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

貢獻者指南

Lint for unused empty function value · rust-lang/rust-clippy#15957 | Good First Issue