do not consume iterator
This commit is contained in:
parent
9b2f8d9377
commit
ade93550ad
11
src/lib.rs
11
src/lib.rs
|
@ -145,11 +145,14 @@ impl Iterator for Decoder {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn decode_raw(filename: &str, frames_root: &str) -> anyhow::Result<Vec<Vec<u16>>> {
|
pub fn decode_raw(filename: &str, frames_root: &str) -> anyhow::Result<Vec<Vec<u16>>> {
|
||||||
let packiter = PacketsIterator::new(filename)?;
|
let mut packiter = PacketsIterator::new(filename)?;
|
||||||
let data = packiter.collect::<Vec<_>>();
|
let mut data = vec![];
|
||||||
// let (i, size) = (packiter.i, packiter.size);
|
while let Some(p) = packiter.next() {
|
||||||
|
data.push(p);
|
||||||
|
}
|
||||||
|
let (i, size) = (packiter.i, packiter.size);
|
||||||
|
|
||||||
//println!("found {} packets, saved {}, {} size", i, data.len(), size);
|
println!("found {} packets, saved {}, {} size", i, data.len(), size);
|
||||||
let dump_filename = format!("{}/dump.bin", filename);
|
let dump_filename = format!("{}/dump.bin", filename);
|
||||||
let mut dump = File::create_new(dump_filename);
|
let mut dump = File::create_new(dump_filename);
|
||||||
let mut frames = vec![];
|
let mut frames = vec![];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user