This commit is contained in:
Sanjay K 2020-04-02 08:41:14 -04:00
commit 05ca3d77f7

View File

@ -5,7 +5,7 @@
// you can modify anything EXCEPT for this function's sig // you can modify anything EXCEPT for this function's sig
fn print_number(maybe_number: Option<u16>) { fn print_number(maybe_number: Option<u16>) {
println!("printing: {}", *maybe_number); println!("printing: {}", maybe_number.unwrap());
} }
fn main() { fn main() {
@ -15,7 +15,7 @@ fn main() {
let mut numbers: [Option<u16>; 5]; let mut numbers: [Option<u16>; 5];
for iter in 0..5 { for iter in 0..5 {
let number_to_add: u16 = { let number_to_add: u16 = {
((iter * 5) + 2) / (4 * 16); ((iter * 5) + 2) / (4 * 16)
}; };
numbers[iter] = number_to_add; numbers[iter] = number_to_add;