]> git.lizzy.rs Git - rust.git/blob - src/docs/must_use_unit.txt
[Arithmetic] Consider literals
[rust.git] / src / docs / must_use_unit.txt
1 ### What it does
2 Checks for a `#[must_use]` attribute on
3 unit-returning functions and methods.
4
5 ### Why is this bad?
6 Unit values are useless. The attribute is likely
7 a remnant of a refactoring that removed the return type.
8
9 ### Examples
10 ```
11 #[must_use]
12 fn useless() { }
13 ```