mirror of
https://codeberg.org/icewind/php-literal-parser.git
synced 2026-06-03 18:44:07 +02:00
flake updates + clippy fixes
This commit is contained in:
parent
0127eecad2
commit
5d9cf6de77
6 changed files with 35 additions and 35 deletions
|
|
@ -96,7 +96,7 @@ impl Display for TokenList {
|
|||
let mut tokens = self.0[0..self.0.len() - 1].iter();
|
||||
write!(f, "{}", tokens.next().unwrap())?;
|
||||
for token in tokens {
|
||||
write!(f, ", {}", token)?;
|
||||
write!(f, ", {token}")?;
|
||||
}
|
||||
if self.0.len() > 1 {
|
||||
write!(f, " or {}", self.0.last().unwrap())?;
|
||||
|
|
|
|||
18
src/lib.rs
18
src/lib.rs
|
|
@ -300,14 +300,14 @@ impl From<HashMap<Key, Value>> for Value {
|
|||
impl Display for Value {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
Value::Bool(val) => write!(f, "{}", val),
|
||||
Value::Int(val) => write!(f, "{}", val),
|
||||
Value::Float(val) => write!(f, "{}", val),
|
||||
Value::String(val) => write!(f, "{}", val),
|
||||
Value::Bool(val) => write!(f, "{val}"),
|
||||
Value::Int(val) => write!(f, "{val}"),
|
||||
Value::Float(val) => write!(f, "{val}"),
|
||||
Value::String(val) => write!(f, "{val}"),
|
||||
Value::Array(val) => {
|
||||
writeln!(f, "[")?;
|
||||
for (key, value) in val.iter() {
|
||||
write!(f, "\t{} => {},", key, value)?;
|
||||
write!(f, "\t{key} => {value},")?;
|
||||
}
|
||||
write!(f, "]")
|
||||
}
|
||||
|
|
@ -479,8 +479,8 @@ impl Index<i64> for Value {
|
|||
impl Display for Key {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
Key::Int(val) => write!(f, "{}", val),
|
||||
Key::String(val) => write!(f, "{}", val),
|
||||
Key::Int(val) => write!(f, "{val}"),
|
||||
Key::String(val) => write!(f, "{val}"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -567,7 +567,7 @@ impl<'de> Visitor<'de> for ValueVisitor {
|
|||
E: de::Error,
|
||||
{
|
||||
Ok(Value::Int(v.try_into().map_err(|_| {
|
||||
E::custom(format!("i64 out of range: {}", v))
|
||||
E::custom(format!("i64 out of range: {v}"))
|
||||
})?))
|
||||
}
|
||||
|
||||
|
|
@ -725,7 +725,7 @@ impl<'de> Visitor<'de> for KeyVisitor {
|
|||
E: de::Error,
|
||||
{
|
||||
Ok(Key::Int(v.try_into().map_err(|_| {
|
||||
E::custom(format!("i64 out of range: {}", v))
|
||||
E::custom(format!("i64 out of range: {v}"))
|
||||
})?))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -647,7 +647,7 @@ impl<'de> MapAccess<'de> for ArrayWalker<'de, '_> {
|
|||
self.next_int_key += 1;
|
||||
self.de.push_peeked(next);
|
||||
self.de.push_peeked(token);
|
||||
seed.deserialize(format!("{}", key).into_deserializer())
|
||||
seed.deserialize(key.to_string().into_deserializer())
|
||||
.map(Some)
|
||||
}
|
||||
}
|
||||
|
|
@ -768,7 +768,7 @@ mod tests {
|
|||
match super::from_str(source) {
|
||||
Ok(res) => Ok(res),
|
||||
Err(err) => {
|
||||
eprintln!("{}", err);
|
||||
eprintln!("{err}");
|
||||
Err(err)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue