These are chat archives for rust-lang/rust

15th
Mar 2017
Sean Kerr
@seankerr
Mar 15 2017 03:30
I have a function that accepts a &[u8] and returns an iterator, but because the iterator struct needs to hold a reference to the &[u8] passed into the function, I'm receiving lifetime issues. How do I work with this?
Here's the code in question. The error is on line 2, it's saying context needs a lifetime, even though it's owned by QueryIterator. The suspect the issue is that the ByteStream type contains a reference to the passed in &[u8]. https://is.gd/ndLOjL
Sean Kerr
@seankerr
Mar 15 2017 03:37
Crap, I completely missed that I still needed the ByteStream<'a>. Sorry everyone.