Skip to content

Commit afef1f0

Browse files
committed
Auto merge of #6546 - k-nasa:fix_clippy_warning, r=ehuss
Fix clippy warning ## Fixed according to warning of clippy - Remove unnecessary return keywords - Remove unnecessary name assignment
2 parents ea47200 + 3aaeee5 commit afef1f0

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/cargo/core/manifest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ impl ser::Serialize for Target {
286286
kind: &self.kind,
287287
crate_types: self.rustc_crate_types(),
288288
name: &self.name,
289-
src_path: src_path,
289+
src_path,
290290
edition: &self.edition.to_string(),
291291
required_features: self
292292
.required_features

src/cargo/ops/cargo_new.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,8 @@ struct IgnoreList {
422422
impl IgnoreList {
423423
/// constructor to build a new ignore file
424424
fn new() -> IgnoreList {
425-
return IgnoreList{
426-
ignore: Vec::new(),
425+
IgnoreList {
426+
ignore: Vec::new(),
427427
hg_ignore: Vec::new(),
428428
}
429429
}
@@ -440,9 +440,9 @@ impl IgnoreList {
440440
/// version control system as `String`.
441441
fn format_new(&self, vcs: VersionControl) -> String {
442442
match vcs {
443-
VersionControl::Hg => return self.hg_ignore.join("\n"),
444-
_ => return self.ignore.join("\n"),
445-
};
443+
VersionControl::Hg => self.hg_ignore.join("\n"),
444+
_ => self.ignore.join("\n"),
445+
}
446446
}
447447

448448
/// format_existing is used to format the IgnoreList when the ignore file
@@ -501,7 +501,7 @@ fn write_ignore_file(base_path: &Path, list: &IgnoreList, vcs: VersionControl) -
501501

502502
paths::append(&fp_ignore, ignore.as_bytes())?;
503503

504-
return Ok(ignore)
504+
Ok(ignore)
505505
}
506506

507507
/// initialize the correct vcs system based on the provided config

0 commit comments

Comments
 (0)