Summary
Clippy incorrectly formats a function body when removing a redundant unit expression (()), leaving behind an empty line.
Reproducer
Code:
pub fn foo(x: usize) -> () {
let _ = x;
()
}
Current output:
pub fn foo(x: usize) {
let _ = x;
}
Desired output:
pub fn foo(x: usize) {
let _ = x;
}
Version
clippy 0.1.97 (36ba2c7712 2026-04-23)
Summary
Clippy incorrectly formats a function body when removing a redundant unit expression (
()), leaving behind an empty line.Reproducer
Code:
Current output:
Desired output:
Version