Skip to content

Commit 0b81086

Browse files
Eagerly convert some ctors to use their specialized ctors
1 parent 879899c commit 0b81086

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

clippy_lints/src/methods/unnecessary_to_owned.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -336,12 +336,9 @@ fn check_other_call_arg<'tcx>(
336336
&& let Some((n_refs, receiver_ty)) = if n_refs > 0 || is_copy(cx, receiver_ty) {
337337
Some((n_refs, receiver_ty))
338338
} else if trait_predicate.def_id() != deref_trait_id {
339-
Some((1, Ty::new_ref(cx.tcx,
339+
Some((1, Ty::new_imm_ref(cx.tcx,
340340
cx.tcx.lifetimes.re_erased,
341-
ty::TypeAndMut {
342-
ty: receiver_ty,
343-
mutbl: Mutability::Not,
344-
},
341+
receiver_ty,
345342
)))
346343
} else {
347344
None

0 commit comments

Comments
 (0)