Skip to content

Commit f72cf05

Browse files
committed
Fix clippy warnings
1 parent 5464908 commit f72cf05

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

src/cmd/clone.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,7 @@ pub fn run(sess: &Session, path: &Path, matches: &ArgMatches) -> Result<()> {
125125
.arg("add")
126126
.arg("origin")
127127
.arg(
128-
&sess
129-
.dependency(sess.dependency_with_name(dep)?)
128+
sess.dependency(sess.dependency_with_name(dep)?)
130129
.source
131130
.to_str(),
132131
)

src/config.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -882,10 +882,7 @@ impl Validate for PartialVendorPackage {
882882
})?,
883883
None => return Err(Error::new("external import upstream missing")),
884884
},
885-
mapping: match self.mapping {
886-
Some(mapping) => mapping,
887-
None => Vec::new(),
888-
},
885+
mapping: self.mapping.unwrap_or_default(),
889886
patch_dir: match self.patch_dir {
890887
Some(patch_dir) => Some(env_path_from_string(patch_dir)?),
891888
None => None,
@@ -895,10 +892,7 @@ impl Validate for PartialVendorPackage {
895892
None => vec![String::from("")],
896893
},
897894
exclude_from_upstream: {
898-
let mut excl = match self.exclude_from_upstream {
899-
Some(exclude_from_upstream) => exclude_from_upstream,
900-
None => Vec::new(),
901-
};
895+
let mut excl = self.exclude_from_upstream.unwrap_or_default();
902896
excl.push(String::from(".git"));
903897
excl
904898
},

0 commit comments

Comments
 (0)