I am trying to implement a lookup function that will return a mutable reference to a value contained within the `self` value. Normally, since the returned reference points to data that is owned outside of the `lookup` function (`self.verts`), the borrow checker sees no problem with that. In my case, however, I am filtering `self.verts` prior to returning the reference and binding it to a new, owned name. When I try to return a value from that locally owned array I get the compile time error:

```none
error: `vs` does not live long enough
  --> src/util/graph.rs:18:37
   |
18 |         if vs.len() > 0 { Some(&mut vs[0]) } else { None }
   |                                     ^^ does not live long enough
19 |     }
   |     - borrowed value only lives until here
   |
note: borrowed value must be valid for the lifetime 'a as defined on the body at 16:75...
  --> src/util/graph.rs:16:76
   |
16 |       pub fn lookup_id<'a>(&'a mut self, id: &str) -> Option<&'a mut Vertex> {
   |  ____________________________________________________________________________^ starting here...
17 | |         let vs:Vec<&mut Vertex> = self.verts.iter_mut().filter(|x| x.id == id).collect();
18 | |         if vs.len() > 0 { Some(&mut vs[0]) } else { None }
19 | |     }
   | |_____^ ...ending here

```

I understand that I can't return a reference to locally owned content, and I suspect that is how the compiler is interpreting my code, but that is not what I want to do. What a want to do is return a reference to a value in the `self.verts` vector so that the returned reference has the same lifetime and the struct the lookup is being performed on. Here is my current attempt:

```
pub fn lookup_id<'a>(&'a mut self, id: &str) -> Option<&'a mut Vertex> {
    let vs:Vec<&'a mut Vertex> = self.verts.iter_mut().filter(|x| x.id == id).collect();
    if vs.len() > 0 { Some(&mut vs[0]) } else { None }
}

```

This code does not compile because `vs does not live long enough`. How do I tell the compiler that a want to return a reference contained in `vs` and not a reference to `vs`?