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

贡献者指南