♻️ (util): Extrae non_blank() y normalize_token()
This commit is contained in:
parent
747e64ce34
commit
dc2ed27da4
8 changed files with 71 additions and 37 deletions
|
|
@ -1,4 +1,4 @@
|
|||
use crate::AutoDefault;
|
||||
use crate::{AutoDefault, util};
|
||||
|
||||
use serde::{Deserialize, Deserializer};
|
||||
|
||||
|
|
@ -201,10 +201,9 @@ impl FromStr for UnitValue {
|
|||
type Err = String;
|
||||
|
||||
fn from_str(input: &str) -> Result<Self, Self::Err> {
|
||||
let s = input.trim();
|
||||
if s.is_empty() {
|
||||
let Some(s) = util::non_blank(input) else {
|
||||
return Ok(UnitValue::None);
|
||||
}
|
||||
};
|
||||
if s.eq_ignore_ascii_case("auto") {
|
||||
return Ok(UnitValue::Auto);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue