Guest User

Untitled

a guest
Nov 21st, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. pub struct Event<'a> {
  2. title: &'a str,
  3. }
  4.  
  5.  
  6.  
  7. fn main() {
  8. let event = vec![Event{title:"a"}, Event{title:"b"}, Event{title:"c"}];
  9. let evt = event.first().unwrap();
  10. tho(evt);
  11. }
  12.  
  13. fn tho(evt: &Event) {
  14. println!("{}",evt.title)
  15. }
Add Comment
Please, Sign In to add comment