feat: fix clippy & update dependencies

This commit is contained in:
2024-04-21 11:15:14 +08:00
parent 68473e2f01
commit b3d8c791c4
4 changed files with 44 additions and 47 deletions

View File

@@ -166,10 +166,7 @@ fn split_claim(claim: &str) -> Option<(String, Value)> {
let mut claim_chars = claim.chars().peekable();
let ty = if let Some('^') = claim_chars.peek() {
let _ = claim_chars.next();
match claim_chars.next() {
None => return None,
Some(t) => Some(t),
}
claim_chars.next()
} else {
None
};
@@ -192,7 +189,7 @@ fn split_claim(claim: &str) -> Option<(String, Value)> {
match ty {
None | Some('s') => Some((k, Value::String(v))),
Some('b') => Some((k, Value::Bool(vec!["true", "yes", "1"].contains(&v.as_str())))),
Some('b') => Some((k, Value::Bool(["true", "yes", "1"].contains(&v.as_str())))),
Some('i') | Some('n') => {
if let Ok(i) = v.parse::<i64>() {
return Some((k, Value::Number(Number::from(i))));