Skip to content

Commit 39c236e

Browse files
epagedjc
authored andcommitted
refactor: Don't bother grabbing lock for tests
We already hold a lock and the performance loss is not likely to be noticed
1 parent 256ea28 commit 39c236e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/process/terminal_source.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use anstyle::{Reset, Style};
1414

1515
use super::Process;
1616
#[cfg(feature = "test")]
17-
use super::file_source::{TestWriter, TestWriterLock};
17+
use super::file_source::TestWriter;
1818

1919
/// A colorable terminal that can be written to
2020
pub struct ColorableTerminal {
@@ -102,7 +102,7 @@ impl ColorableTerminal {
102102
TerminalInnerLocked::Stderr(AutoStream::new(locked, self.color_choice))
103103
}
104104
#[cfg(feature = "test")]
105-
TerminalInner::TestWriter(w, _) => TerminalInnerLocked::TestWriter(w.lock()),
105+
TerminalInner::TestWriter(w, _) => TerminalInnerLocked::TestWriter(w.clone()),
106106
});
107107
// ColorableTerminalLocked { inner, guard, locked }
108108
uninit.assume_init()
@@ -282,7 +282,7 @@ enum TerminalInnerLocked {
282282
Stdout(AutoStream<io::StdoutLock<'static>>),
283283
Stderr(AutoStream<io::StderrLock<'static>>),
284284
#[cfg(feature = "test")]
285-
TestWriter(TestWriterLock<'static>),
285+
TestWriter(TestWriter),
286286
}
287287

288288
impl TerminalInnerLocked {

0 commit comments

Comments
 (0)