lints: warn on needless_return

The needless_return lint was disabled almost two years ago, alongside
several other lints. It might have been helpful for porting from C++.
Now, I think we can enable that lint again, since omitting the returns
results in equivalent, more concise code, which should not be harder to
read.

The only manual changes in this commit are removing the lint exception
from `Cargo.toml` and removing the unnecessary returns inside `cfg_if!`
macro invocations (in `src/fd_monitor.rs` and `src/proc.rs`).
All other changes were generated by
`cargo clippy --workspace --all-targets --fix && cargo fmt`

Closes #12189
This commit is contained in:
Daniel Rainer
2025-12-18 23:33:57 +01:00
committed by Johannes Altmanninger
parent b62a312cba
commit 17c35217b9
52 changed files with 132 additions and 146 deletions

View File

@@ -94,7 +94,7 @@ pub fn parse_inf_nan(
}
return Some(f64::NEG_INFINITY);
}
return None;
None
}
fn wcstod_inner<I>(mut chars: I, decimal_sep: char, consumed: &mut usize) -> Result<f64, Error>