Summary
The lint does not trigger for and_then calls even when they are in return position.
Context: uutils/coreutils@2df9af6
Reproducer: https://rust.godbolt.org/z/odMvevebj
Lint Name
question_mark
Reproducer
I tried this code:
fn foo(from: &Path, to: &Path) -> io::Result<()> {
make_fifo(to).and_then(|_| fs::remove_file(from))
}
I expected to see this happen:
Warning, with a suggestion
fn foo(from: &Path, to: &Path) -> io::Result<()> {
make_fifo(to)?;
fs::remove_file(from)
}
Instead, this happened:
No warning
Version
clippy 0.1.97 (52b6e2c208 2026-04-27)
Summary
The lint does not trigger for
and_thencalls even when they are in return position.Context: uutils/coreutils@2df9af6
Reproducer: https://rust.godbolt.org/z/odMvevebj
Lint Name
question_markReproducer
I tried this code:
I expected to see this happen:
Warning, with a suggestion
Instead, this happened:
No warning
Version