Skip to content

Commit a315f2f

Browse files
committed
chore: added more descriptive TODOs
1 parent be0b7e0 commit a315f2f

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

exercises/conversions/as_ref_mut.rs

+7-6
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,22 @@
55

66
// I AM NOT DONE
77

8-
// Obtain the number of bytes (not characters) in the given argument
9-
// Add the AsRef trait appropriately as a trait bound
8+
// Obtain the number of bytes (not characters) in the given argument.
9+
// TODO: Add the AsRef trait appropriately as a trait bound.
1010
fn byte_counter<T>(arg: T) -> usize {
1111
arg.as_ref().as_bytes().len()
1212
}
1313

14-
// Obtain the number of characters (not bytes) in the given argument
15-
// Add the AsRef trait appropriately as a trait bound
14+
// Obtain the number of characters (not bytes) in the given argument.
15+
// TODO: Add the AsRef trait appropriately as a trait bound.
1616
fn char_counter<T>(arg: T) -> usize {
1717
arg.as_ref().chars().count()
1818
}
1919

20-
// Squares a number using as_mut(). Add the trait bound as is appropriate and
21-
// implement the function body.
20+
// Squares a number using as_mut().
21+
// TODO: Add the appropriate trait bound.
2222
fn num_sq<T>(arg: &mut T) {
23+
// TODO: Implement the function body.
2324
???
2425
}
2526

exercises/options/options1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
// This function returns how much icecream there is left in the fridge.
77
// If it's before 10PM, there's 5 pieces left. At 10PM, someone eats them
88
// all, so there'll be no more left :(
9-
// TODO: Return an Option!
109
fn maybe_icecream(time_of_day: u16) -> Option<u16> {
1110
// We use the 24-hour system here, so 10PM is a value of 22 and 12AM is a value of 0
1211
// The Option output should gracefully handle cases where time_of_day > 23.
12+
// TODO: Complete the function body - remember to return an Option!
1313
???
1414
}
1515

exercises/traits/traits1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ trait AppendBar {
1616
}
1717

1818
impl AppendBar for String {
19-
//Add your code here
19+
// TODO: Implement `AppendBar` for type `String`.
2020
}
2121

2222
fn main() {

exercises/traits/traits2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ trait AppendBar {
1717
fn append_bar(self) -> Self;
1818
}
1919

20-
//TODO: Add your code here
20+
// TODO: Implement trait `AppendBar` for a vector of strings.
2121

2222
#[cfg(test)]
2323
mod tests {

0 commit comments

Comments
 (0)