Skip to content

Commit fc26b5e

Browse files
committed
I AM NOT DONE comment in conversions exercise files
1 parent 0c85dc1 commit fc26b5e

File tree

5 files changed

+6
-0
lines changed

5 files changed

+6
-0
lines changed

exercises/conversions/as_ref_mut.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
// Read more about them at https://doc.rust-lang.org/std/convert/trait.AsRef.html
33
// and https://doc.rust-lang.org/std/convert/trait.AsMut.html, respectively.
44

5+
// I AM NOT DONE
56
// Obtain the number of bytes (not characters) in the given argument
67
// Add the AsRef trait appropriately as a trait bound
78
fn byte_counter<T>(arg: T) -> usize {
89
arg.as_ref().as_bytes().len()
910
}
1011

12+
// I AM NOT DONE
1113
// Obtain the number of characters (not bytes) in the given argument
1214
// Add the AsRef trait appropriately as a trait bound
1315
fn char_counter<T>(arg: T) -> usize {

exercises/conversions/from_into.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ impl Default for Person {
1818
}
1919
}
2020

21+
// I AM NOT DONE
2122
// Your task is to complete this implementation
2223
// in order for the line `let p = Person::from("Mark,20")` to compile
2324
// Please note that you'll need to parse the age component into a `usize`

exercises/conversions/from_str.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ struct Person {
1010
age: usize,
1111
}
1212

13+
// I AM NOT DONE
1314
// Steps:
1415
// 1. If the length of the provided string is 0, then return an error
1516
// 2. Split the given string on the commas present in it

exercises/conversions/try_from_into.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ struct Person {
1010
age: usize,
1111
}
1212

13+
// I AM NOT DONE
1314
// Your task is to complete this implementation
1415
// in order for the line `let p = Person::try_from("Mark,20")` to compile
1516
// and return an Ok result of inner type Person.

exercises/conversions/using_as.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Please note that the `as` operator is not only used when type casting.
33
// It also helps with renaming imports.
44

5+
// I AM NOT DONE
56
// The goal is to make sure that the division does not fail to compile
67
fn average(values: &[f64]) -> f64 {
78
let total = values

0 commit comments

Comments
 (0)