Skip to content

Commit 1755ac9

Browse files
committed
Fix clippy error
1 parent a3f661b commit 1755ac9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

clippy_lints/src/redundant_clone.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,11 +320,11 @@ fn find_stmt_assigns_to<'tcx>(
320320

321321
match (by_ref, &*rvalue) {
322322
(true, mir::Rvalue::Ref(_, _, place)) | (false, mir::Rvalue::Use(mir::Operand::Copy(place))) => {
323-
base_local_and_movability(cx, mir, *place)
323+
Some(base_local_and_movability(cx, mir, *place))
324324
},
325325
(false, mir::Rvalue::Ref(_, _, place)) => {
326326
if let [mir::ProjectionElem::Deref] = place.as_ref().projection {
327-
base_local_and_movability(cx, mir, *place)
327+
Some(base_local_and_movability(cx, mir, *place))
328328
} else {
329329
None
330330
}
@@ -341,7 +341,7 @@ fn base_local_and_movability<'tcx>(
341341
cx: &LateContext<'tcx>,
342342
mir: &mir::Body<'tcx>,
343343
place: mir::Place<'tcx>,
344-
) -> Option<(mir::Local, CannotMoveOut)> {
344+
) -> (mir::Local, CannotMoveOut) {
345345
use rustc_middle::mir::PlaceRef;
346346

347347
// Dereference. You cannot move things out from a borrowed value.
@@ -362,7 +362,7 @@ fn base_local_and_movability<'tcx>(
362362
&& !is_copy(cx, mir::Place::ty_from(local, projection, &mir.local_decls, cx.tcx).ty);
363363
}
364364

365-
Some((local, deref || field || slice))
365+
(local, deref || field || slice)
366366
}
367367

368368
struct LocalUseVisitor {

0 commit comments

Comments
 (0)