Skip to content

Commit

Permalink
I AM NOT DONE comment in conversions exercise files
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdouSeck committed Dec 16, 2019
1 parent f0b2223 commit 4bdd91e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions exercises/conversions/as_ref_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
// Read more about them at https://doc.rust-lang.org/std/convert/trait.AsRef.html
// and https://doc.rust-lang.org/std/convert/trait.AsMut.html, respectively.

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

// I AM NOT DONE
// Obtain the number of characters (not bytes) in the given argument
// Add the AsRef trait appropriately as a trait bound
fn char_counter<T>(arg: T) -> usize {
Expand Down
1 change: 1 addition & 0 deletions exercises/conversions/from_into.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ impl Default for Person {
}
}

// I AM NOT DONE
// Your task is to complete this implementation
// in order for the line `let p = Person::from("Mark,20")` to compile
// Please note that you'll need to parse the age component into a `usize`
Expand Down
1 change: 1 addition & 0 deletions exercises/conversions/from_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ struct Person {
age: usize,
}

// I AM NOT DONE
// Steps:
// 1. If the length of the provided string is 0, then return an error
// 2. Split the given string on the commas present in it
Expand Down
1 change: 1 addition & 0 deletions exercises/conversions/try_from_into.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ struct Person {
age: usize,
}

// I AM NOT DONE
// Your task is to complete this implementation
// in order for the line `let p = Person::try_from("Mark,20")` to compile
// and return an Ok result of inner type Person.
Expand Down
1 change: 1 addition & 0 deletions exercises/conversions/using_as.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Please note that the `as` operator is not only used when type casting.
// It also helps with renaming imports.

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

0 comments on commit 4bdd91e

Please sign in to comment.