Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
動く
#[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