I have a largeish buffer containing bytes that I would like to avoid
copying. The first thing I have to do with this buffer is parse it into
a hashmap structure. To that end, I have the following function:

fn line_map<'b>(buffer : &'b [u8]) -> ~LinearMap<&'b [u8],&'b [u8]> {...}

The problem I am running into is that the type of the LinearMap's find()
method (Yes, this is 0.6.) is:

fn find(&self, k: &&'b [u8]) -> Option<&'self &'b [u8]>

In other words, the key argument is a borrowed pointer to a borrowed
pointer to a vector with the same lifetime as the buffer. That argument
is kind of difficult to provide.

What am I doing wrong? Is there a better way?


-- 
Tommy M. McGuire
[email protected]
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to