Skip to content

Commit 1aee98a

Browse files
Dylan-DPCMark-Simulacrum
authored andcommitted
remove mem replace instead
1 parent 52ad6b8 commit 1aee98a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/cargo/sources/git/utils.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ use serde::Serialize;
1111
use std::env;
1212
use std::fmt;
1313
use std::fs::File;
14-
use std::mem;
1514
use std::path::{Path, PathBuf};
1615
use std::process::Command;
1716
use url::Url;
@@ -835,7 +834,7 @@ fn maybe_gc_repo(repo: &mut git2::Repository) -> CargoResult<()> {
835834
);
836835
if out.status.success() {
837836
let new = git2::Repository::open(repo.path())?;
838-
let _ = mem::replace(repo, new);
837+
*repo = new;
839838
return Ok(());
840839
}
841840
}

0 commit comments

Comments
 (0)