fix(clippy): clippy fixes

This commit is contained in:
Kat Marchán 2024-12-20 01:34:23 -08:00
parent 12b2fd2f4f
commit 4cbc32246c
No known key found for this signature in database
GPG Key ID: AEB529C08A3C7E9E
1 changed files with 4 additions and 4 deletions

View File

@ -172,7 +172,7 @@ impl KdlEntry {
// but just in case. // but just in case.
let s = x.value_repr.trim(); let s = x.value_repr.trim();
// convert raw strings to new format // convert raw strings to new format
let s = s.strip_prefix("r").unwrap_or(s); let s = s.strip_prefix('r').unwrap_or(s);
let s = if crate::value::is_plain_ident(val) { let s = if crate::value::is_plain_ident(val) {
val.to_string() val.to_string()
} else if s } else if s
@ -186,16 +186,16 @@ impl KdlEntry {
} else { } else {
// `"` -> `"""` but also extra newlines need to be // `"` -> `"""` but also extra newlines need to be
// added because v2 strips the first and last ones. // added because v2 strips the first and last ones.
let s = s.replacen("\"", "\"\"\"\n", 1); let s = s.replacen('\"', "\"\"\"\n", 1);
s.chars() s.chars()
.rev() .rev()
.collect::<String>() .collect::<String>()
.replacen("\"", "\"\"\"\n", 1) .replacen('\"', "\"\"\"\n", 1)
.chars() .chars()
.rev() .rev()
.collect::<String>() .collect::<String>()
} }
} else if !s.starts_with("#") { } else if !s.starts_with('#') {
// `/` is no longer an escaped char in v2. // `/` is no longer an escaped char in v2.
s.replace("\\/", "/") s.replace("\\/", "/")
} else { } else {