Skip to content

Commit 9a19cda

Browse files
committed
Don't fetch all crates on clean
Only fetch those that are needed by avoiding `ops::fetch`
1 parent 8bdec5e commit 9a19cda

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/cargo/ops/cargo_clean.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use std::fs;
33
use std::path::Path;
44

55
use core::{Package, Profiles};
6+
use core::registry::PackageRegistry;
67
use util::{CargoResult, human, ChainError, Config};
78
use ops::{self, Layout, Context, BuildConfig, Kind, Unit};
89

@@ -28,7 +29,9 @@ pub fn clean(manifest_path: &Path, opts: &CleanOptions) -> CargoResult<()> {
2829
return rm_rf(&target_dir);
2930
}
3031

31-
let (resolve, packages) = try!(ops::fetch(manifest_path, opts.config));
32+
let mut registry = PackageRegistry::new(opts.config);
33+
let resolve = try!(ops::resolve_pkg(&mut registry, &root, opts.config));
34+
let packages = ops::get_resolved_packages(&resolve, registry);
3235

3336
let dest = if opts.release {"release"} else {"debug"};
3437
let host_layout = try!(Layout::new(opts.config, &root, None, dest));

0 commit comments

Comments
 (0)