Refactor stderr_prints_nothing into a more modular function
This commit is contained in:
@@ -10,14 +10,13 @@
|
||||
|
||||
use fmt;
|
||||
use io::prelude::*;
|
||||
use sys::stdio::{Stderr, stderr_prints_nothing};
|
||||
use sys::stdio::panic_output;
|
||||
use thread;
|
||||
|
||||
pub fn dumb_print(args: fmt::Arguments) {
|
||||
if stderr_prints_nothing() {
|
||||
return
|
||||
if let Some(mut out) = panic_output() {
|
||||
let _ = out.write_fmt(args);
|
||||
}
|
||||
let _ = Stderr::new().map(|mut stderr| stderr.write_fmt(args));
|
||||
}
|
||||
|
||||
// Other platforms should use the appropriate platform-specific mechanism for
|
||||
|
||||
Reference in New Issue
Block a user