Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
kennykerr committed Nov 16, 2023
1 parent ca81e1c commit 9815b6d
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions crates/tools/lib/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::collections::BTreeMap;
use regex::Regex;
use std::collections::BTreeMap;
use std::path::Path;

pub enum CallingConvention {
Expand Down Expand Up @@ -102,16 +102,10 @@ fn find<P: AsRef<Path>>(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()));
}
}
}
Expand Down

0 comments on commit 9815b6d

Please sign in to comment.