diff --git a/build.rs b/build.rs index 1cff84c5..8326fcdc 100644 --- a/build.rs +++ b/build.rs @@ -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)?; diff --git a/src/lua_ast.rs b/src/lua_ast.rs index c31b609f..a61e41c9 100644 --- a/src/lua_ast.rs +++ b/src/lua_ast.rs @@ -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. diff --git a/src/path_serializer.rs b/src/path_serializer.rs index 74eb9534..29edaf82 100644 --- a/src/path_serializer.rs +++ b/src/path_serializer.rs @@ -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) } diff --git a/src/web/interface.rs b/src/web/interface.rs index 28005057..c10e14bc 100644 --- a/src/web/interface.rs +++ b/src/web/interface.rs @@ -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