diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2018-09-05 14:00:16 +0200 |
---|---|---|
committer | Kostya Shishkov <kostya.shishkov@gmail.com> | 2018-09-05 14:00:16 +0200 |
commit | 5eb3cc6035c6c247ffd7e0ac2e3f0f49f1e2ee7b (patch) | |
tree | 75a64bbbab70e8bdbb761e1b36636c6f02ff5ffb | |
parent | 4c6c19cb19126ed8c95f1077472e81991de8bb1c (diff) | |
download | nihav-5eb3cc6035c6c247ffd7e0ac2e3f0f49f1e2ee7b.tar.gz |
io: make writer consume outputter
-rw-r--r-- | src/io/byteio.rs | 10 | ||||
-rw-r--r-- | src/test/dec_video.rs | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/io/byteio.rs b/src/io/byteio.rs index ca591ac..e172a32 100644 --- a/src/io/byteio.rs +++ b/src/io/byteio.rs @@ -370,8 +370,8 @@ pub struct MemoryWriter<'a> { pos: usize, } -pub struct FileWriter<'a> { - file: &'a File, +pub struct FileWriter { + file: File, } impl<'a> ByteWriter<'a> { @@ -519,13 +519,13 @@ impl<'a> ByteIO for MemoryWriter<'a> { } } -impl<'a> FileWriter<'a> { - pub fn new_write(file: &'a mut File) -> Self { +impl FileWriter { + pub fn new_write(file: File) -> Self { FileWriter { file: file } } } -impl<'a> ByteIO for FileWriter<'a> { +impl ByteIO for FileWriter { #[allow(unused_variables)] fn read_byte(&mut self) -> ByteIOResult<u8> { Err(ByteIOError::NotImplemented) diff --git a/src/test/dec_video.rs b/src/test/dec_video.rs index 61577c4..a2cf6e7 100644 --- a/src/test/dec_video.rs +++ b/src/test/dec_video.rs @@ -180,8 +180,8 @@ pub fn test_decode_audio(demuxer: &str, name: &str, limit: Option<u64>, audio_pf } let name = format!("assets/{}out.wav", audio_pfx); - let mut file = File::create(name).unwrap(); - let mut fw = FileWriter::new_write(&mut file); + let file = File::create(name).unwrap(); + let mut fw = FileWriter::new_write(file); let mut wr = ByteWriter::new(&mut fw); let mut wwr = WavWriter::new(&mut wr); let mut wrote_header = false; |