rust-lang/rust-clippy

Lint for unused empty function value

Open

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

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

倉庫指標

Star
 (10,406 star)
PR 合併指標
 (平均合併 19天 22小時) (30 天內合併 113 個 PR)

描述

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

貢獻者指南