RS.CLIPPY.MUST_USE_UNIT

`#[must_use]` attribute on a unit-returning function / method

This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: must_use_unit. Copyright ©2025 The Rust Team. All rights reserved.

What it does

Checks for a #[must_use] attribute on unit-returning functions and methods.

Why is this bad?

Unit values are useless. The attribute is likely a remnant of a refactoring that removed the return type.

Examples

#[must_use]
fn useless() { }