From 405fe0c4b09d6bb07ee895096a4f12b4279eeb32 Mon Sep 17 00:00:00 2001 From: Michael Rogenmoser Date: Wed, 21 Aug 2024 17:42:06 +0200 Subject: [PATCH] Fix clippy warnings --- src/cmd/clone.rs | 2 +- src/config.rs | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/cmd/clone.rs b/src/cmd/clone.rs index 45cce1b9..2a6cb596 100644 --- a/src/cmd/clone.rs +++ b/src/cmd/clone.rs @@ -125,7 +125,7 @@ pub fn run(sess: &Session, path: &Path, matches: &ArgMatches) -> Result<()> { .arg("add") .arg("origin") .arg( - &sess + sess .dependency(sess.dependency_with_name(dep)?) .source .to_str(), diff --git a/src/config.rs b/src/config.rs index b2e63884..58c08f83 100644 --- a/src/config.rs +++ b/src/config.rs @@ -882,10 +882,7 @@ impl Validate for PartialVendorPackage { })?, None => return Err(Error::new("external import upstream missing")), }, - mapping: match self.mapping { - Some(mapping) => mapping, - None => Vec::new(), - }, + mapping: self.mapping.unwrap_or_default(), patch_dir: match self.patch_dir { Some(patch_dir) => Some(env_path_from_string(patch_dir)?), None => None, @@ -895,10 +892,7 @@ impl Validate for PartialVendorPackage { None => vec![String::from("")], }, exclude_from_upstream: { - let mut excl = match self.exclude_from_upstream { - Some(exclude_from_upstream) => exclude_from_upstream, - None => Vec::new(), - }; + let mut excl = self.exclude_from_upstream.unwrap_or_default(); excl.push(String::from(".git")); excl },