Skip to content

Instantly share code, notes, and snippets.

@cocomoff
Created June 2, 2019 12:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cocomoff/5681a50c7f0c54e0ab403b3861d64cbc to your computer and use it in GitHub Desktop.
Save cocomoff/5681a50c7f0c54e0ab403b3861d64cbc to your computer and use it in GitHub Desktop.
動く
#[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