These are chat archives for rust-lang/rust
Hi, I'm having some trouble figuring out how to do something so I'm hoping someone can have idea.
Basically I'm trying to implement
Iteratorover a file that reads data in chunks using
and then parse the variably sized records using NOM. The thing is when I reach the end of the first 8k buffer I have some data left
in it but it's not enough to parse next record so NOM returns
IResult::Incompleteand then I call
fill_buff()again but I'm getting the same buffer back.
Do I have to consume the whole buffer so that it gets refilled? This means probably that I have to store this remainder somewhere?
So, I just mmap-ed the file using the
memmap crate, which seems to work fine. There is just a tiny bit of
unsafe to get the mmaped file as byte slice.
how can i expand this to check that s.parse() doesn't overflow?
let args: Vec<usize> = argument.split("d").map(|s| s.parse().unwrap()).collect();