Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #[derive(Clone)]
- struct Score{
- score: f64,
- }
- fn main() {
- let mut my_array:Vec<Option<Score>>= vec![None;5000];
- my_array[0]= Some(Score{score:0.5});
- println!("{}",my_array[0].as_ref().unwrap().score);
- my_array[0].as_mut().unwrap().score= 100.0;
- println!("{}",my_array[0].as_ref().unwrap().score);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement