forked from rojo-rbx/rojo
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:
@@ -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.
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user