m/cup
1
0
mirror of https://github.com/sergi0g/cup.git synced 2025-11-16 09:03:46 -05:00

I think you can guess

This commit is contained in:
Sergio
2025-02-18 17:47:14 +02:00
parent cf22ec300f
commit 05d4c7c630
2 changed files with 3 additions and 3 deletions

View File

@@ -56,11 +56,11 @@ impl Version {
}; };
let minor: Option<u32> = c.name("minor").map(|minor| { let minor: Option<u32> = c.name("minor").map(|minor| {
positions.push((minor.start(), minor.end())); positions.push((minor.start(), minor.end()));
minor.as_str().parse().expect(&format!("Minor version invalid in tag {}", tag)) minor.as_str().parse().unwrap_or_else(|_| panic!("Minor version invalid in tag {}", tag))
}); });
let patch: Option<u32> = c.name("patch").map(|patch| { let patch: Option<u32> = c.name("patch").map(|patch| {
positions.push((patch.start(), patch.end())); positions.push((patch.start(), patch.end()));
patch.as_str().parse().expect(&format!("Patch version invalid in tag {}", tag)) patch.as_str().parse().unwrap_or_else(|_| panic!("Patch version invalid in tag {}", tag))
}); });
let mut format_str = tag.to_string(); let mut format_str = tag.to_string();
positions.reverse(); positions.reverse();

View File

@@ -18,7 +18,7 @@ pub fn parse_www_authenticate(www_auth: &str) -> String {
if *key == "realm" { if *key == "realm" {
return acc.to_owned() + value.as_escaped() + "?"; return acc.to_owned() + value.as_escaped() + "?";
} else { } else {
return format!("{}&{}={}", acc, key, value.as_escaped()); format!("{}&{}={}", acc, key, value.as_escaped())
} }
}) })
} else { } else {