Skip to content
This repository has been archived by the owner on Jun 5, 2020. It is now read-only.

Commit

Permalink
fix most clippy warnings
Browse files Browse the repository at this point in the history
there are two 'too_many_arguments' warnings left.
  • Loading branch information
M1cha committed Feb 24, 2020
1 parent 9b6cad2 commit d896155
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/format/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ impl Pattern {
RawChunk::Argument("l") => Chunk::License,
RawChunk::Argument("r") => Chunk::Repository,
RawChunk::Argument(ref a) => {
return Err(anyhow!("unsupported pattern `{}`", a).into());
return Err(anyhow!("unsupported pattern `{}`", a));
}
RawChunk::Error(err) => return Err(anyhow!("{}", err)),
};
Expand Down
2 changes: 1 addition & 1 deletion src/format/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub struct Parser<'a> {
impl<'a> Parser<'a> {
pub fn new(s: &'a str) -> Parser<'a> {
Parser {
s: s,
s,
it: s.char_indices().peekable(),
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pub fn print(args: &Args, graph: &Graph) -> Result<(), Error> {
}

fn find_package<'a>(package: &str, graph: &'a Graph) -> Result<&'a PackageId, Error> {
let mut it = package.split(":");
let mut it = package.split(':');
let name = it.next().unwrap();
let version = it
.next()
Expand All @@ -107,7 +107,7 @@ fn find_package<'a>(package: &str, graph: &'a Graph) -> Result<&'a PackageId, Er
candidates.push(package);
}

if candidates.len() == 0 {
if candidates.is_empty() {
Err(anyhow!("no crates found for package `{}`", package))
} else if candidates.len() > 1 {
let specs = candidates
Expand Down

0 comments on commit d896155

Please sign in to comment.