Suggest eprintln!(…) instead of writeln!(io::stderr(), …) #2083
Labels
A-lint
Area: New lints
good-first-issue
These issues are a good way to get started with Clippy
L-unnecessary
Lint: Warn about unnecessary code
T-AST
Type: Requires working with the AST
The error versions of
print!
andprintln!
have been stable since Rust 1.19. We should suggest using them!Basically, this:
can be replaced by
We should take care to only suggest this for the default
stderr
handle, and not, e.g., for one the programmer called.lock()
on.(Inspired by rust-lang/rust#44822)
The text was updated successfully, but these errors were encountered: