diff options
| author | mark <markm@cs.wisc.edu> | 2020-06-11 21:31:49 -0500 |
|---|---|---|
| committer | mark <markm@cs.wisc.edu> | 2020-07-27 19:51:13 -0500 |
| commit | 2c31b45ae878b821975c4ebd94cc1e49f6073fd0 (patch) | |
| tree | 14f64e683e3f64dcbcfb8c2c7cb45ac7592e6e09 /src/libtest/helpers/sink.rs | |
| parent | 9be8ffcb0206fc1558069a7b4766090df7877659 (diff) | |
| download | rust-2c31b45ae878b821975c4ebd94cc1e49f6073fd0.tar.gz rust-2c31b45ae878b821975c4ebd94cc1e49f6073fd0.zip | |
mv std libs to library/
Diffstat (limited to 'src/libtest/helpers/sink.rs')
| -rw-r--r-- | src/libtest/helpers/sink.rs | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/src/libtest/helpers/sink.rs b/src/libtest/helpers/sink.rs deleted file mode 100644 index aa7fe248773..00000000000 --- a/src/libtest/helpers/sink.rs +++ /dev/null @@ -1,24 +0,0 @@ -//! Module providing a helper structure to capture output in subprocesses. - -use std::{ - io, - io::prelude::Write, - sync::{Arc, Mutex}, -}; - -pub struct Sink(Arc<Mutex<Vec<u8>>>); - -impl Sink { - pub fn new_boxed(data: &Arc<Mutex<Vec<u8>>>) -> Box<Self> { - Box::new(Self(data.clone())) - } -} - -impl Write for Sink { - fn write(&mut self, data: &[u8]) -> io::Result<usize> { - Write::write(&mut *self.0.lock().unwrap(), data) - } - fn flush(&mut self) -> io::Result<()> { - Ok(()) - } -} |
