From 9815b6dece963cae836f61d44c5820f0745af0fb Mon Sep 17 00:00:00 2001 From: Kenny Kerr Date: Thu, 16 Nov 2023 10:29:42 -0600 Subject: [PATCH] fmt --- crates/tools/lib/src/lib.rs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/crates/tools/lib/src/lib.rs b/crates/tools/lib/src/lib.rs index 6ee852748f..441169f90b 100644 --- a/crates/tools/lib/src/lib.rs +++ b/crates/tools/lib/src/lib.rs @@ -1,5 +1,5 @@ -use std::collections::BTreeMap; use regex::Regex; +use std::collections::BTreeMap; use std::path::Path; pub enum CallingConvention { @@ -102,16 +102,10 @@ fn find>(path: P, regex: &Regex) -> Vec<(String, String)> { names.append(&mut find(file.path(), regex)); } else if file.file_name() == "Cargo.toml" { let text = std::fs::read_to_string(file.path()).expect("Cargo.toml"); - let captures = regex - .captures(&text) - .expect("captures"); - let name = captures - .get(1) - .expect("name"); - let version = captures - .get(2) - .expect("version"); - names.push((name.as_str().to_string(), version.as_str().to_string())); + let captures = regex.captures(&text).expect("captures"); + let name = captures.get(1).expect("name"); + let version = captures.get(2).expect("version"); + names.push((name.as_str().to_string(), version.as_str().to_string())); } } }