diff --git a/src/lib.rs b/src/lib.rs index f6990b4..6619b89 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -145,11 +145,14 @@ impl Iterator for Decoder { } pub fn decode_raw(filename: &str, frames_root: &str) -> anyhow::Result>> { - let packiter = PacketsIterator::new(filename)?; - let data = packiter.collect::>(); - // let (i, size) = (packiter.i, packiter.size); + let mut packiter = PacketsIterator::new(filename)?; + let mut data = vec![]; + 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 mut dump = File::create_new(dump_filename); let mut frames = vec![];