Skip to content

Commit 69073a3

Browse files
committed
made a start
1 parent bd17a59 commit 69073a3

File tree

5 files changed

+6
-4
lines changed

5 files changed

+6
-4
lines changed

exercises/01_intro/00_welcome/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
// You can also find solutions to all exercises in the `solutions` git branch.
1818
fn greeting() -> &'static str {
1919
// TODO: fix me 👇
20-
"I'm ready to __!"
20+
"I'm ready to learn Rust!"
2121
}
2222

2323
// Your solutions will be automatically verified by a set of tests.

exercises/01_intro/01_syntax/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// partner in this course and it'll often guide you in the right direction!
44
//
55
// The input parameters should have the same type of the return type.
6-
fn compute(a, b) -> u32 {
6+
fn compute(a: u32, b: u32) -> u32 {
77
// Don't touch the function body.
88
a + b * 2
99
}

exercises/02_basic_calculator/00_intro/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
fn intro() -> &'static str {
22
// TODO: fix me 👇
3-
"I'm ready to __!"
3+
"I'm ready to build a calculator in Rust!"
44
}
55

66
#[cfg(test)]

exercises/02_basic_calculator/01_integers/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
fn compute(a: u32, b: u32) -> u32 {
22
// TODO: change the line below to fix the compiler error and make the tests pass.
3-
a + b * 4u8
3+
a + b * 4u32
44
}
55

66
#[cfg(test)]

exercises/02_basic_calculator/02_variables/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ pub fn speed(start: u32, end: u32, time_elapsed: u32) -> u32 {
99
// TODO: define a variable named `distance` with the right value to get tests to pass
1010
// Do you need to annotate the type of `distance`? Why or why not?
1111

12+
let distance = end - start;
13+
1214
// Don't change the line below
1315
distance / time_elapsed
1416
}

0 commit comments

Comments
 (0)