Skip to content

Commit 9a0ffec

Browse files
authored
remove redundant clones in exercise examples (#1016)
1 parent 978aed9 commit 9a0ffec

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

exercises/book-store/example.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ impl Iterator for DecomposeGroups {
154154
let mut book_iter = backing_bt.iter();
155155
*book_iter.next().unwrap()
156156
};
157-
hypothetical = groups.clone();
157+
hypothetical = groups;
158158
hypothetical[0].0.borrow_mut().remove(&book);
159159
hypothetical.push(Group::new_containing(book));
160160
hypothetical.sort();

exercises/grep/example.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ pub fn grep(pattern: &str, flags: &Flags, files: &[&str]) -> Result<Vec<String>,
6767
let mut inner_pattern = String::from(pattern);
6868

6969
if flags.use_caseinsensitive_comparison {
70-
inner_line = inner_line.to_lowercase().to_string();
70+
inner_line = inner_line.to_lowercase();
7171

72-
inner_pattern = inner_pattern.to_lowercase().to_string();
72+
inner_pattern = inner_pattern.to_lowercase();
7373
}
7474

7575
if flags.use_inverted_comparison {

0 commit comments

Comments
 (0)