chore: regex remove default features
All checks were successful
ci/woodpecker/push/linux Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/push/mingw Pipeline was successful

This commit is contained in:
nyyu 2025-05-31 20:43:40 +02:00
parent 54ef7ebac6
commit 3430a0a6ee
3 changed files with 6 additions and 4 deletions

View file

@ -11,7 +11,7 @@ indexmap = {version = "2.2", features = ["serde", "rayon"]}
log = "0.4" log = "0.4"
logsy = "1.0.1" logsy = "1.0.1"
rayon = "1.10" rayon = "1.10"
regex = "1.11.1" regex = {version = "1.11.1", features = ["std"], default-features = false}
serde = "1.0" serde = "1.0"
serde_derive = "1.0" serde_derive = "1.0"
serde_json = {version = "1.0", features = ["preserve_order"]} serde_json = {version = "1.0", features = ["preserve_order"]}

View file

@ -385,7 +385,8 @@ mod tests {
let client = ureq::Agent::config_builder() let client = ureq::Agent::config_builder()
.user_agent(USER_AGENT_VALUE) .user_agent(USER_AGENT_VALUE)
.timeout_global(Some(Duration::from_secs(10))) .timeout_global(Some(Duration::from_secs(10)))
.build().into(); .build()
.into();
let datasource = KBDataSource::new(); let datasource = KBDataSource::new();
let champion = ChampionLoL { let champion = ChampionLoL {
data: IndexMap::new(), data: IndexMap::new(),
@ -399,7 +400,8 @@ mod tests {
let client = ureq::Agent::config_builder() let client = ureq::Agent::config_builder()
.user_agent(USER_AGENT_VALUE) .user_agent(USER_AGENT_VALUE)
.timeout_global(Some(Duration::from_secs(10))) .timeout_global(Some(Duration::from_secs(10)))
.build().into(); .build()
.into();
let datasource = KBDataSource::new(); let datasource = KBDataSource::new();
let champ = ChampInfo { let champ = ChampInfo {
id: String::from("Annie"), id: String::from("Annie"),

View file

@ -26,7 +26,7 @@ fn get_champ_from_name(champs: &Champion, name: String) -> Option<u32> {
} }
fn find_next_number(rest: &str) -> f32 { fn find_next_number(rest: &str) -> f32 {
let re = Regex::new(r"(\d+\.?\d+)").unwrap(); let re = Regex::new(r"([0-9]+\.?[0-9]+)").unwrap();
if let Some(cap) = re.captures(rest) { if let Some(cap) = re.captures(rest) {
if let Some(matched) = cap.get(1) { if let Some(matched) = cap.get(1) {
return matched.as_str().parse::<f32>().unwrap_or(0.0); return matched.as_str().parse::<f32>().unwrap_or(0.0);