Guest User

Untitled

a guest
Mar 23rd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. use std::vec::Vec;
  2. use std::option::Option;
  3.  
  4. trait MyTrait {
  5. fn bar(&self, vec: &Vec<u32>) -> Option<&u32>;
  6. }
  7.  
  8. struct Foo;
  9.  
  10. impl MyTrait for Foo {
  11. fn bar<'a>(&self, vec: &'a Vec<u32>) -> Option<&'a u32> {
  12. vec.get(0)
  13. }
  14. }
  15.  
  16. fn main() {}
Add Comment
Please, Sign In to add comment