Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 8fb1b17

Browse files
authored
Merge pull request rust-lang#3140 from matthiaskrgr/redundant_clones
fix clippy::redundant_clones warnings.
2 parents 593ac52 + 6863850 commit 8fb1b17

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/imports.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ impl UseTree {
248248
.rewrite(context, shape.offset_left(vis.len())?)
249249
.map(|s| {
250250
if s.is_empty() {
251-
s.to_owned()
251+
s
252252
} else {
253253
format!("{}use {};", vis, s)
254254
}
@@ -592,7 +592,7 @@ fn merge_rest(a: &[UseSegment], b: &[UseSegment], len: usize) -> Option<UseSegme
592592
if let UseSegment::List(mut list) = a_rest[0].clone() {
593593
merge_use_trees_inner(&mut list, UseTree::from_path(b_rest.to_vec(), DUMMY_SP));
594594
list.sort();
595-
return Some(UseSegment::List(list.clone()));
595+
return Some(UseSegment::List(list));
596596
}
597597
let mut list = vec![
598598
UseTree::from_path(a_rest.to_vec(), DUMMY_SP),

src/matches.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -549,9 +549,9 @@ fn nop_block_collapse(block_str: Option<String>, budget: usize) -> Option<String
549549
&& budget >= 2
550550
&& (block_str[1..].find(|c: char| !c.is_whitespace()).unwrap() == block_str.len() - 2)
551551
{
552-
"{}".to_owned()
552+
String::from("{}")
553553
} else {
554-
block_str.to_owned()
554+
block_str
555555
}
556556
})
557557
}

0 commit comments

Comments
 (0)