We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider an example program that produces a list to stdout, but takes some time doing so:
use std::{thread, time}; fn main() { let millis = time::Duration::from_millis(100); println!("a"); thread::sleep(millis); println!("b"); thread::sleep(millis); println!("c"); }
# works ./target/debug/piper | grep a # crashes and shows me a rust backtrace ./target/debug/piper | grep -q a
The only related issue I found was #35108 which talks about using write! instead so you could handle the errors.
write!
Sure enough, instead of println! using:
println!
let _ = io::stdout().write(b"a\n");
everywhere does fix it. But is this really a good substitute?
If we are writing CLI tools and are printing formatted strings to stdout we now have to start stuff like:
let _ = io::stdout().write(&format!("{}\n", svc).as_bytes());
which feels like a lot of faff for a "println that i don't care if the program i wrote into disappeared or not".
The text was updated successfully, but these errors were encountered:
Duplicate of #46016
Sorry, something went wrong.
No branches or pull requests
Consider an example program that produces a list to stdout, but takes some time doing so:
The only related issue I found was #35108 which talks about using
write!
instead so you could handle the errors.Sure enough, instead of
println!
using:everywhere does fix it. But is this really a good substitute?
If we are writing CLI tools and are printing formatted strings to stdout we now have to start stuff like:
which feels like a lot of faff for a "println that i don't care if the program i wrote into disappeared or not".
The text was updated successfully, but these errors were encountered: