Skip to content

Commit f994e0a

Browse files
authored
Merge pull request #62 from rust-lang/cleanup-61
Cleanup unused code after #61
2 parents f31db6d + 5b95062 commit f994e0a

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

src/prepare.rs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ pub(crate) struct Prepare<'a> {
1313
toolchain: &'a Toolchain,
1414
krate: &'a Crate,
1515
source_dir: &'a Path,
16-
lockfile_captured: bool,
1716
patches: Vec<CratePatch>,
1817
}
1918

@@ -30,7 +29,6 @@ impl<'a> Prepare<'a> {
3029
toolchain,
3130
krate,
3231
source_dir,
33-
lockfile_captured: false,
3432
patches,
3533
}
3634
}
@@ -40,7 +38,7 @@ impl<'a> Prepare<'a> {
4038
self.validate_manifest()?;
4139
self.remove_override_files()?;
4240
self.tweak_toml()?;
43-
self.capture_lockfile(false)?;
41+
self.capture_lockfile()?;
4442
self.fetch_deps()?;
4543

4644
Ok(())
@@ -94,8 +92,8 @@ impl<'a> Prepare<'a> {
9492
Ok(())
9593
}
9694

97-
fn capture_lockfile(&mut self, force: bool) -> Result<(), Error> {
98-
if !force && self.source_dir.join("Cargo.lock").exists() {
95+
fn capture_lockfile(&mut self) -> Result<(), Error> {
96+
if self.source_dir.join("Cargo.lock").exists() {
9997
info!(
10098
"crate {} already has a lockfile, it will not be regenerated",
10199
self.krate
@@ -136,7 +134,6 @@ impl<'a> Prepare<'a> {
136134
}
137135
other => other?,
138136
}
139-
self.lockfile_captured = true;
140137
Ok(())
141138
}
142139

@@ -153,13 +150,6 @@ impl<'a> Prepare<'a> {
153150
.run();
154151
match res {
155152
Ok(_) => Ok(()),
156-
Err(_) if !self.lockfile_captured => {
157-
info!("the lockfile is outdated, regenerating it");
158-
// Force-update the lockfile and recursively call this function to fetch
159-
// dependencies again.
160-
self.capture_lockfile(true)?;
161-
self.fetch_deps()
162-
}
163153
Err(_) if missing_deps => Err(PrepareError::MissingDependencies.into()),
164154
err => err.map_err(|e| e.into()),
165155
}

0 commit comments

Comments
 (0)