dependencies; the dependency on `{}` was removed\n\n
{}", override_summary.package_id().name(), id.name(), boilerplate);
self.source_config.config().shell().warn(&msg)?;
+ return Ok(())
}
Ok(())
impl<T> Clone for RcVecIter<T> {
fn clone(&self) -> RcVecIter<T> {
RcVecIter {
- vec: Rc::clone(&self.vec),
+ vec: self.vec.clone(),
rest: self.rest.clone(),
}
}
}
let root = root_manifest.parent().unwrap();
- if let WorkspaceConfig::Root { ref members, ref exclude } = *self.packages.load(root_manifest)?.workspace_config() {
- if is_excluded(members, exclude, root, &manifest_path) {
- return Ok(())
+ match *self.packages.load(root_manifest)?.workspace_config() {
+ WorkspaceConfig::Root { ref members, ref exclude } => {
+ if is_excluded(members, exclude, root, &manifest_path) {
+ return Ok(())
+ }
}
+ _ => {}
}
debug!("find_members - {}", manifest_path.display());
let mut changes = BTreeMap::new();
let empty = (Vec::new(), Vec::new());
for dep in previous_resolve.iter() {
- changes.entry(key(dep)).or_insert_with(|| empty.clone()).0.push(dep);
+ changes.entry(key(dep)).or_insert(empty.clone()).0.push(dep);
}
for dep in resolve.iter() {
- changes.entry(key(dep)).or_insert_with(|| empty.clone()).1.push(dep);
+ changes.entry(key(dep)).or_insert(empty.clone()).1.push(dep);
}
for v in changes.values_mut() {
}
let tests = vec![
- Test { proposed_path: String::from("src/main.rs"), handling: H::Bin },
- Test { proposed_path: String::from("main.rs"), handling: H::Bin },
+ Test { proposed_path: format!("src/main.rs"), handling: H::Bin },
+ Test { proposed_path: format!("main.rs"), handling: H::Bin },
Test { proposed_path: format!("src/{}.rs", name), handling: H::Detect },
- Test { proposed_path: format!("{}.rs", name), handling: H::Detect },
- Test { proposed_path: String::from("src/lib.rs"), handling: H::Lib },
- Test { proposed_path: String::from("lib.rs"), handling: H::Lib },
+ Test { proposed_path: format!("{}.rs", name), handling: H::Detect },
+ Test { proposed_path: format!("src/lib.rs"), handling: H::Lib },
+ Test { proposed_path: format!("lib.rs"), handling: H::Lib },
];
for i in tests {
let in_existing_vcs_repo = existing_vcs_repo(path.parent().unwrap_or(path), config.cwd());
let vcs = match (opts.version_control, cfg.version_control, in_existing_vcs_repo) {
(None, None, false) => VersionControl::Git,
- (None, Some(option), false) | (Some(option), _, _) => option,
+ (None, Some(option), false) => option,
+ (Some(option), _, _) => option,
(_, _, true) => VersionControl::NoVcs,
};
match vcs {
use std::collections::{HashMap, HashSet};
-use std::collections::hash_map::Entry;
use std::fs;
use std::io;
use std::path::{Path, PathBuf};
};
let pkg = Package::new(manifest, &manifest_path);
- match all_packages.entry(pkg.package_id().clone()) {
- Entry::Occupied(_) => { info!("skipping nested package `{}` found at `{}`",
- pkg.name(), path.to_string_lossy()); },
- Entry::Vacant(e) => { e.insert(pkg); }
+ let pkg_id = pkg.package_id().clone();
+ if !all_packages.contains_key(&pkg_id) {
+ all_packages.insert(pkg_id, pkg);
+ } else {
+ info!("skipping nested package `{}` found at `{}`",
+ pkg.name(), path.to_string_lossy());
}
// Registry sources are not allowed to have `path=` dependencies because
/// Return the target triple which this context is targeting.
pub fn target_triple(&self) -> &str {
- self.requested_target().unwrap_or_else(|| self.host_triple())
+ self.requested_target().unwrap_or(self.host_triple())
}
/// Requested (not actual) target for the build
match *cfg {
Cfg::Name(ref n) => { cfg_map.insert(n.clone(), None); }
Cfg::KeyPair(ref k, ref v) => {
- if let Some(ref mut values) = *cfg_map.entry(k.clone())
- .or_insert_with(|| Some(Vec::new())) {
- values.push(v.clone())
+ match *cfg_map.entry(k.clone()).or_insert(Some(Vec::new())) {
+ Some(ref mut values) => values.push(v.clone()),
+ None => { /* ... */ }
}
}
}
impl hash::Hash for Fingerprint {
fn hash<H: Hasher>(&self, h: &mut H) {
- let Fingerprint { rustc, ref features, target, profile, ref deps,
- ref local, ref rustflags, .. } = *self;
+ let Fingerprint {
+ rustc,
+ ref features,
+ target,
+ profile,
+ ref deps,
+ ref local,
+ memoized_hash: _,
+ ref rustflags,
+ } = *self;
(rustc, features, target, profile, local, rustflags).hash(h);
h.write_usize(deps.len());
let kind = unit.kind;
// Prepare the native lib state (extra -L and -l flags)
- let build_state = Arc::clone(&cx.build_state);
+ let build_state = cx.build_state.clone();
let current_id = unit.pkg.package_id().clone();
let build_deps = load_build_deps(cx, unit);
let target = unit.target.clone();
exec.init(cx, unit);
- let exec = Arc::clone(&exec);
+ let exec = exec.clone();
let root_output = cx.target_root().to_path_buf();
rustdoc.args(&cx.rustdocflags_args(unit)?);
let name = unit.pkg.name().to_string();
- let build_state = Arc::clone(&cx.build_state);
+ let build_state = cx.build_state.clone();
let key = (unit.pkg.package_id().clone(), unit.kind);
Ok(Work::new(move |state| {
let Profile {
ref opt_level, lto, codegen_units, ref rustc_args, debuginfo,
debug_assertions, overflow_checks, rpath, test, doc: _doc,
- run_custom_build, ref panic, check, ..
+ run_custom_build, ref panic, rustdoc_args: _, check,
} = *unit.profile;
assert!(!run_custom_build);
))?;
}
} else if no_include_option {
- self.config
- .shell()
- .warn(format!(
- "Pattern matching for Cargo's include/exclude fields is changing and \
- file `{}` WILL NOT be excluded in a future Cargo version.\n\
- See https://github.com/rust-lang/cargo/issues/4268 for more info",
- relative_path.display()
- ))?;
+ self.config
+ .shell()
+ .warn(format!(
+ "Pattern matching for Cargo's include/exclude fields is changing and \
+ file `{}` WILL NOT be excluded in a future Cargo version.\n\
+ See https://github.com/rust-lang/cargo/issues/4268 for more info",
+ relative_path.display()
+ ))?;
} else {
self.config
.shell()
let name = path.file_name().and_then(|s| s.to_str());
// Skip dotfile directories
if name.map(|s| s.starts_with('.')) == Some(true) {
- continue;
- }
- if is_root {
+ continue
+ } else if is_root {
// Skip cargo artifacts
match name {
Some("target") | Some("Cargo.lock") => continue,
// as 0.
let mtime = fs::metadata(&file).map(|meta| {
FileTime::from_last_modification_time(&meta)
- }).unwrap_or_else(|_| FileTime::zero());
+ }).unwrap_or(FileTime::zero());
warn!("{} {}", mtime, file.display());
if mtime > max {
max = mtime;