Skip to content

Commit

Permalink
fixes clippy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
amincheloh committed Oct 5, 2022
1 parent 9d4a074 commit f29b895
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 f29b895

Please sign in to comment.