Config hot reloading API
This commit is contained in:
@@ -310,7 +310,7 @@ impl<'x> TryFrom<Variable<'x>> for Duration {
|
||||
Variable::Integer(value) if value > 0 => Ok(Duration::from_millis(value as u64)),
|
||||
Variable::Float(value) if value > 0.0 => Ok(Duration::from_millis(value as u64)),
|
||||
Variable::String(value) if !value.is_empty() => {
|
||||
Duration::parse_value("", &value).map_err(|_| ())
|
||||
Duration::parse_value(&value).map_err(|_| ())
|
||||
}
|
||||
_ => Err(()),
|
||||
}
|
||||
|
||||
@@ -336,7 +336,7 @@ impl<'x> Tokenizer<'x> {
|
||||
})
|
||||
} else if let Some(token) = self.token_map.tokens.get(buf.as_str()) {
|
||||
Ok(token.clone())
|
||||
} else if let Ok(duration) = Duration::parse_value("", &buf) {
|
||||
} else if let Ok(duration) = Duration::parse_value(&buf) {
|
||||
Ok(Token::Constant(Constant::Integer(
|
||||
duration.as_millis() as i64
|
||||
)))
|
||||
|
||||
Reference in New Issue
Block a user