Skip to content

Commit b22bd36

Browse files
committed
remove more redundant clones manually
1 parent 476e10e commit b22bd36

File tree

4 files changed

+3
-5
lines changed

4 files changed

+3
-5
lines changed

crates/hir-ty/src/infer/pat.rs

-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ impl InferenceContext<'_> {
233233
};
234234
let mut expectations_iter = expectations
235235
.iter()
236-
.cloned()
237236
.map(|a| a.assert_ty_ref(Interner).clone())
238237
.chain(repeat_with(|| self.table.new_type_var()));
239238

crates/hir/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3673,7 +3673,6 @@ impl Closure {
36733673
let (captures, _) = infer.closure_info(&self.id);
36743674
captures
36753675
.iter()
3676-
.cloned()
36773676
.map(|capture| Type {
36783677
env: db.trait_environment_for_body(owner),
36793678
ty: capture.ty(&self.subst),

crates/ide/src/goto_definition.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ pub(crate) fn goto_definition(
7979
return Some(vec![x]);
8080
}
8181

82-
if let Some(x) = try_lookup_macro_def_in_macro_use(sema, token.clone()) {
82+
if let Some(x) = try_lookup_macro_def_in_macro_use(sema, token) {
8383
return Some(vec![x]);
8484
}
8585
}

crates/ide/src/view_memory_layout.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ impl FieldOrTupleIdx {
6969
.as_str()
7070
.map(|s| s.to_owned())
7171
.unwrap_or_else(|| format!(".{}", f.name(db).as_tuple_index().unwrap())),
72-
FieldOrTupleIdx::TupleIdx(i) => format!(".{i}").to_owned(),
72+
FieldOrTupleIdx::TupleIdx(i) => format!(".{i}"),
7373
}
7474
}
7575
}
@@ -203,7 +203,7 @@ pub(crate) fn view_memory_layout(
203203

204204
let mut nodes = vec![MemoryLayoutNode {
205205
item_name,
206-
typename: typename.clone(),
206+
typename,
207207
size: layout.size(),
208208
offset: 0,
209209
alignment: layout.align(),

0 commit comments

Comments
 (0)