Skip to content

Commit

Permalink
Move clippy comments into expect statements
Browse files Browse the repository at this point in the history
  • Loading branch information
schneems committed Dec 13, 2024
1 parent 45367bb commit 240aa08
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions commons/src/gemfile_lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,12 @@ impl FromStr for GemfileLock {
type Err = std::convert::Infallible;

fn from_str(string: &str) -> Result<Self, Self::Err> {
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()),
Expand Down

0 comments on commit 240aa08

Please sign in to comment.