We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d0d0e78 commit db15596Copy full SHA for db15596
library/std/src/io/stdio.rs
@@ -963,6 +963,11 @@ pub fn set_print(sink: Option<Box<dyn LocalOutput>>) -> Option<Box<dyn LocalOutp
963
}
964
965
pub(crate) fn clone_io() -> (Option<Box<dyn LocalOutput>>, Option<Box<dyn LocalOutput>>) {
966
+ // Don't waste time when LOCAL_{STDOUT,STDERR} are definitely None.
967
+ if !LOCAL_STREAMS.load(Ordering::Relaxed) {
968
+ return (None, None);
969
+ }
970
+
971
LOCAL_STDOUT.with(|stdout| {
972
LOCAL_STDERR.with(|stderr| {
973
(
0 commit comments