2
0
Fork 0
mirror of https://git.asonix.dog/asonix/pict-rs synced 2024-12-22 19:31:35 +00:00
This commit is contained in:
asonix 2023-07-22 21:14:24 -05:00
parent 3ca9caef35
commit d0c619bdf7

View file

@ -44,7 +44,10 @@ impl std::str::FromStr for RetentionValue {
type Err = RetentionValueError; type Err = RetentionValueError;
fn from_str(s: &str) -> Result<Self, Self::Err> { fn from_str(s: &str) -> Result<Self, Self::Err> {
let num_str = s.chars().take_while(|c| c.is_digit(10)).collect::<String>(); let num_str = s
.chars()
.take_while(|c| c.is_ascii_digit())
.collect::<String>();
if num_str.is_empty() { if num_str.is_empty() {
return Err(RetentionValueError::NoValue); return Err(RetentionValueError::NoValue);