From 240aa08d8f9b7c5b83defa6fb544f741c080af37 Mon Sep 17 00:00:00 2001 From: Schneems Date: Fri, 13 Dec 2024 17:13:17 -0600 Subject: [PATCH] Move clippy comments into expect statements --- commons/src/gemfile_lock.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/commons/src/gemfile_lock.rs b/commons/src/gemfile_lock.rs index 9249b69..fd91fc4 100644 --- a/commons/src/gemfile_lock.rs +++ b/commons/src/gemfile_lock.rs @@ -116,13 +116,12 @@ impl FromStr for GemfileLock { type Err = std::convert::Infallible; fn from_str(string: &str) -> Result { - let bundled_with_re = Regex::new("BUNDLED WITH\\s (\\d+\\.\\d+\\.\\d+)") - .expect("Internal error: Bad regex"); // Checked via clippy + let bundled_with_re = + Regex::new("BUNDLED WITH\\s (\\d+\\.\\d+\\.\\d+)").expect("Clippy checked"); let main_ruby_version_re = Regex::new("RUBY VERSION\\s ruby (\\d+\\.\\d+\\.\\d+((-|\\.)\\S*\\d+)?)") - .expect("Internal error: Bad regex"); // Checked via clippy - let jruby_version_re = - Regex::new("\\(jruby ((\\d+|\\.)+)\\)").expect("Internal error: Bad regex"); // Checked via clippy + .expect("Clippy checked"); + let jruby_version_re = Regex::new("\\(jruby ((\\d+|\\.)+)\\)").expect("Clippy checked"); let bundler_version = match bundled_with_re.captures(string).and_then(|c| c.get(1)) { Some(result) => BundlerVersion::Explicit(result.as_str().to_string()),