Fix remaining clippy lints (#687)

The eighth (and final) in a series of PRs that aim to get CI passing
This commit is contained in:
Kenneth Loeffler
2023-06-30 11:06:43 -07:00
committed by GitHub
parent 8646b2dfce
commit 67674d53a2
4 changed files with 27 additions and 13 deletions

View File

@@ -54,7 +54,7 @@ fn main() -> Result<(), anyhow::Error> {
});
let out_path = Path::new(&out_dir).join("plugin.bincode");
let out_file = File::create(&out_path)?;
let out_file = File::create(out_path)?;
bincode::serialize_into(out_file, &snapshot)?;

View File

@@ -219,12 +219,30 @@ fn is_valid_ident_char(value: char) -> bool {
}
fn is_keyword(value: &str) -> bool {
match value {
"and" | "break" | "do" | "else" | "elseif" | "end" | "false" | "for" | "function"
| "if" | "in" | "local" | "nil" | "not" | "or" | "repeat" | "return" | "then" | "true"
| "until" | "while" => true,
_ => false,
}
matches!(
value,
"and"
| "break"
| "do"
| "else"
| "elseif"
| "end"
| "false"
| "for"
| "function"
| "if"
| "in"
| "local"
| "nil"
| "not"
| "or"
| "repeat"
| "return"
| "then"
| "true"
| "until"
| "while"
)
}
/// Tells whether the given string is a valid Lua identifier.

View File

@@ -15,7 +15,7 @@ where
.as_os_str()
.to_str()
.expect("Invalid Unicode in file path, cannot serialize");
let replaced = as_str.replace("\\", "/");
let replaced = as_str.replace('\\', "/");
serializer.serialize_str(&replaced)
}

View File

@@ -145,11 +145,7 @@ fn property_filter(value: Option<&Variant>) -> bool {
// Lua can't do anything with SharedString values. They also can't be
// serialized directly by Serde!
if ty == Some(VariantType::SharedString) {
return false;
}
return true;
ty != Some(VariantType::SharedString)
}
/// Response body from /api/rojo