Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pub struct Event<'a> {
- title: &'a str,
- }
- fn main() {
- let event = vec![Event{title:"a"}, Event{title:"b"}, Event{title:"c"}];
- let evt = event.first().unwrap();
- tho(evt);
- }
- fn tho(evt: &Event) {
- println!("{}",evt.title)
- }
Add Comment
Please, Sign In to add comment