Skip to content

Commit

Permalink
Auto merge of #6546 - k-nasa:fix_clippy_warning, r=ehuss
Browse files Browse the repository at this point in the history
Fix clippy warning

## Fixed according to warning of clippy

- Remove unnecessary return keywords
- Remove unnecessary name assignment
  • Loading branch information
bors committed Jan 12, 2019
2 parents ea47200 + 3aaeee5 commit afef1f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/cargo/core/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ impl ser::Serialize for Target {
kind: &self.kind,
crate_types: self.rustc_crate_types(),
name: &self.name,
src_path: src_path,
src_path,
edition: &self.edition.to_string(),
required_features: self
.required_features
Expand Down
12 changes: 6 additions & 6 deletions src/cargo/ops/cargo_new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,8 @@ struct IgnoreList {
impl IgnoreList {
/// constructor to build a new ignore file
fn new() -> IgnoreList {
return IgnoreList{
ignore: Vec::new(),
IgnoreList {
ignore: Vec::new(),
hg_ignore: Vec::new(),
}
}
Expand All @@ -440,9 +440,9 @@ impl IgnoreList {
/// version control system as `String`.
fn format_new(&self, vcs: VersionControl) -> String {
match vcs {
VersionControl::Hg => return self.hg_ignore.join("\n"),
_ => return self.ignore.join("\n"),
};
VersionControl::Hg => self.hg_ignore.join("\n"),
_ => self.ignore.join("\n"),
}
}

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

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

return Ok(ignore)
Ok(ignore)
}

/// initialize the correct vcs system based on the provided config
Expand Down

0 comments on commit afef1f0

Please sign in to comment.