From f29b8950fed8e4bd2b4058854c85b074e67515a0 Mon Sep 17 00:00:00 2001 From: Amin Cheloh Date: Tue, 4 Oct 2022 13:50:49 +0700 Subject: [PATCH] fixes clippy issues --- src/version.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/version.rs b/src/version.rs index 378c21e..4302e09 100644 --- a/src/version.rs +++ b/src/version.rs @@ -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)),