From a06744b3e8700c221ed462969ee8996ed357a242 Mon Sep 17 00:00:00 2001 From: dylan_DPC Date: Mon, 20 Apr 2020 15:08:26 +0200 Subject: [PATCH 1/2] fix mem replace unused --- src/cargo/sources/git/utils.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cargo/sources/git/utils.rs b/src/cargo/sources/git/utils.rs index 2f54b846e3b..27fba2863f3 100644 --- a/src/cargo/sources/git/utils.rs +++ b/src/cargo/sources/git/utils.rs @@ -838,7 +838,7 @@ fn maybe_gc_repo(repo: &mut git2::Repository) -> CargoResult<()> { ); if out.status.success() { let new = git2::Repository::open(repo.path())?; - mem::replace(repo, new); + let _ = mem::replace(repo, new); return Ok(()); } } From ee98c3517c78e870b8d9aa7fdc18b70ea5dae0d0 Mon Sep 17 00:00:00 2001 From: dylan_DPC Date: Mon, 20 Apr 2020 15:40:41 +0200 Subject: [PATCH 2/2] remove mem replace instead --- src/cargo/sources/git/utils.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/cargo/sources/git/utils.rs b/src/cargo/sources/git/utils.rs index 27fba2863f3..08efd065b4e 100644 --- a/src/cargo/sources/git/utils.rs +++ b/src/cargo/sources/git/utils.rs @@ -11,7 +11,6 @@ use serde::Serialize; use std::env; use std::fmt; use std::fs::File; -use std::mem; use std::path::{Path, PathBuf}; use std::process::Command; use url::Url; @@ -838,7 +837,7 @@ fn maybe_gc_repo(repo: &mut git2::Repository) -> CargoResult<()> { ); if out.status.success() { let new = git2::Repository::open(repo.path())?; - let _ = mem::replace(repo, new); + *repo = new; return Ok(()); } }