Created
October 29, 2015 17:19
-
-
Save ooooak/1cccc828a631078c7960 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[derive(Debug, Clone, Copy)] | |
pub struct User<'a>{ | |
pub Token: &'a Vec<String>, | |
pub look: &'a usize, | |
} | |
impl<'a> User<'a>{ | |
pub fn display(u: User){ | |
println!("{:?}", u); | |
} | |
} | |
fn main() { | |
let value = vec!["test".to_string()]; | |
let u = User{ | |
Token: &value, | |
look: &0, | |
}; | |
mmove(u); | |
println!("{:?}", u); | |
} | |
fn mmove(u: User){ | |
println!("{:?}", u); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment