mirror of
https://github.com/storytold/deckcraft.git
synced 2026-11-15 06:35:50 +00:00
Apply review fixes
- xtask/src/version.rs
This commit is contained in:
1 parent
10fef35fe6
commit
3c60448691
1 file changed
+5
-1
@@ -45,7 +45,11 @@ pub fn validate(v: &str) -> Result<(), String> {
|
||||
None => (v, None),
|
||||
};
|
||||
let nums: Vec<&str> = core.split('.').collect();
|
||||
if nums.len() != 3 || nums.iter().any(|n| n.is_empty() || !n.bytes().all(|b| b.is_ascii_digit()) || (n.len() > 1 && n.starts_with('0'))) {
|
||||
if nums.len() != 3
|
||||
|| nums
|
||||
.iter()
|
||||
.any(|n| n.is_empty() || !n.bytes().all(|b| b.is_ascii_digit()) || n.parse::<u64>().is_err() || (n.len() > 1 && n.starts_with('0')))
|
||||
{
|
||||
return bad();
|
||||
}
|
||||
if let Some(p) = pre
|
||||
|
||||
Reference in new issue
Block a user