Skip to content

Commit ea5ea52

Browse files
authored
circular-buffer, parallel-letter-frequency: use to_string() (#1026)
clippy::useless_format https://rust-lang.github.io/rust-clippy/master/index.html#useless_format Helps address #1011
1 parent 29e56ac commit ea5ea52

File tree

2 files changed

+2
-2
lines changed
  • exercises
    • circular-buffer/src
    • parallel-letter-frequency/src

2 files changed

+2
-2
lines changed

exercises/circular-buffer/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ impl<T> CircularBuffer<T> {
1919
unimplemented!(
2020
"Construct a new CircularBuffer with the capacity to hold {}.",
2121
match capacity {
22-
1 => format!("1 element"),
22+
1 => "1 element".to_string(),
2323
_ => format!("{} elements", capacity),
2424
}
2525
);

exercises/parallel-letter-frequency/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pub fn frequency(input: &[&str], worker_count: usize) -> HashMap<char, usize> {
55
"Count the frequency of letters in the given input '{:?}'. Ensure that you are using {} to process the input.",
66
input,
77
match worker_count {
8-
1 => format!("1 worker"),
8+
1 => "1 worker".to_string(),
99
_ => format!("{} workers", worker_count),
1010
}
1111
);

0 commit comments

Comments
 (0)