Skip to content

Commit 4ede64b

Browse files
authored
Merge pull request #1279 from tkburis/main
Minor changes
2 parents 4521aed + db53dbc commit 4ede64b

File tree

6 files changed

+14
-13
lines changed

6 files changed

+14
-13
lines changed

exercises/conversions/as_ref_mut.rs

Lines changed: 7 additions & 6 deletions
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

Lines changed: 1 addition & 1 deletion
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/quiz2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ mod my_module {
4242

4343
#[cfg(test)]
4444
mod tests {
45-
// TODO: What do we have to import to have `transformer` in scope?
45+
// TODO: What do we need to import to have `transformer` in scope?
4646
use ???;
4747
use super::Command;
4848

exercises/traits/traits1.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Time to implement some traits!
33
//
44
// Your task is to implement the trait
5-
// `AppendBar' for the type `String'.
5+
// `AppendBar` for the type `String`.
66
//
77
// The trait AppendBar has only one function,
88
// which appends "Bar" to any object
@@ -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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// traits2.rs
22
//
33
// Your task is to implement the trait
4-
// `AppendBar' for a vector of strings.
4+
// `AppendBar` for a vector of strings.
55
//
66
// To implement this trait, consider for
77
// a moment what it means to 'append "Bar"'
@@ -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 {

info.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ name = "traits2"
695695
path = "exercises/traits/traits2.rs"
696696
mode = "test"
697697
hint = """
698-
Notice how the trait takes ownership of 'self',and returns `Self'.
698+
Notice how the trait takes ownership of 'self',and returns `Self`.
699699
Try mutating the incoming string vector. Have a look at the tests to see
700700
what the result should look like!
701701

0 commit comments

Comments
 (0)