From 9e7faba7f3e3e4c86815c8a3f40b191e39d4920a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 3 Feb 2026 05:59:58 +0000 Subject: [PATCH] Auto-format: cargo fmt --all --- crates/vm/src/protocol/object.rs | 2 +- crates/vm/src/stdlib/ast/python.rs | 5 +---- crates/vm/src/stdlib/builtins.rs | 16 +++++++--------- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/crates/vm/src/protocol/object.rs b/crates/vm/src/protocol/object.rs index 9c4dcb043..d0e068e50 100644 --- a/crates/vm/src/protocol/object.rs +++ b/crates/vm/src/protocol/object.rs @@ -704,7 +704,7 @@ impl PyObject { if let Some(class_getitem) = vm.get_attribute_opt(self.to_owned(), identifier!(vm, __class_getitem__))? - && !vm.is_none(&class_getitem) + && !vm.is_none(&class_getitem) { return class_getitem.call((needle,), vm); } diff --git a/crates/vm/src/stdlib/ast/python.rs b/crates/vm/src/stdlib/ast/python.rs index 5bea02c64..17062c99a 100644 --- a/crates/vm/src/stdlib/ast/python.rs +++ b/crates/vm/src/stdlib/ast/python.rs @@ -137,10 +137,7 @@ pub(crate) mod _ast { let is_list_field = if field_name == "args" { class_name == "Call" || class_name == "arguments" } else if field_name == "body" || field_name == "orelse" { - !matches!( - class_name.as_str(), - "Lambda" | "Expression" | "IfExp" - ) + !matches!(class_name.as_str(), "Lambda" | "Expression" | "IfExp") } else { LIST_FIELDS.contains(&field_name) }; diff --git a/crates/vm/src/stdlib/builtins.rs b/crates/vm/src/stdlib/builtins.rs index ee9c26e33..c9e7d0e9f 100644 --- a/crates/vm/src/stdlib/builtins.rs +++ b/crates/vm/src/stdlib/builtins.rs @@ -154,15 +154,13 @@ mod builtins { // compile(ast_node, ..., PyCF_ONLY_AST) returns the AST after validation if is_ast_only { - let (expected_type, expected_name) = ast::mode_type_and_name( - &vm.ctx, mode_str, - ) - .ok_or_else(|| { - vm.new_value_error( - "compile() mode must be 'exec', 'eval', 'single' or 'func_type'" - .to_owned(), - ) - })?; + let (expected_type, expected_name) = ast::mode_type_and_name(&vm.ctx, mode_str) + .ok_or_else(|| { + vm.new_value_error( + "compile() mode must be 'exec', 'eval', 'single' or 'func_type'" + .to_owned(), + ) + })?; if !args.source.fast_isinstance(&expected_type) { return Err(vm.new_type_error(format!( "expected {} node, got {}",