Skip to content

Commit

Permalink
Merge #50
Browse files Browse the repository at this point in the history
50: fixes Clippy issues r=cuviper a=amincheloh



Co-authored-by: Amin Cheloh <[email protected]>
  • Loading branch information
bors[bot] and amincheloh authored Oct 6, 2022
2 parents 9d4a074 + f29b895 commit e75324c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,15 @@ impl Version {

// Split the version into semver components.
let mut iter = version.splitn(3, '.');
let major = try!(iter.next().ok_or(error::from_str("missing major version")));
let minor = try!(iter.next().ok_or(error::from_str("missing minor version")));
let patch = try!(iter.next().ok_or(error::from_str("missing patch version")));
let major = try!(iter
.next()
.ok_or_else(|| error::from_str("missing major version")));
let minor = try!(iter
.next()
.ok_or_else(|| error::from_str("missing minor version")));
let patch = try!(iter
.next()
.ok_or_else(|| error::from_str("missing patch version")));

Ok(Version::new(
try!(major.parse().map_err(error::from_num)),
Expand Down

0 comments on commit e75324c

Please sign in to comment.