pos: usize,
}
-pub struct FileWriter<'a> {
- file: &'a File,
+pub struct FileWriter {
+ file: File,
}
impl<'a> ByteWriter<'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)
}
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;