solution to exercise 02_02

This commit is contained in:
David Doblas Jiménez 2024-06-13 16:46:44 +02:00
parent 03a0a77394
commit 1e516bf0a5

View File

@ -8,7 +8,7 @@
pub fn speed(start: u32, end: u32, time_elapsed: u32) -> u32 { pub fn speed(start: u32, end: u32, time_elapsed: u32) -> u32 {
// TODO: define a variable named `distance` with the right value to get tests to pass // TODO: define a variable named `distance` with the right value to get tests to pass
// Do you need to annotate the type of `distance`? Why or why not? // Do you need to annotate the type of `distance`? Why or why not?
let distance: u32 = end - start;
// Don't change the line below // Don't change the line below
distance / time_elapsed distance / time_elapsed
} }