Created
June 2, 2019 12:24
-
-
Save cocomoff/5681a50c7f0c54e0ab403b3861d64cbc 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)] | |
struct Mafuyu { | |
max_value: usize, | |
list_of_values: Vec<usize>, | |
} | |
impl Mafuyu { | |
pub fn new(lov: Vec<usize>) -> Mafuyu { | |
let max_v = lov.iter().max().unwrap(); | |
Mafuyu{max_value: *max_v, list_of_values: lov} | |
} | |
} | |
fn main() { | |
let v = vec![3, 2, 5, 10, 0]; | |
let mafuyu = Mafuyu::new(v); | |
println!("{:?}", mafuyu); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment