Auto-format: cargo fmt --all

This commit is contained in:
github-actions[bot]
2026-02-03 05:59:58 +00:00
parent 00cdb307e3
commit 9e7faba7f3
3 changed files with 9 additions and 14 deletions

View File

@@ -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);
}

View File

@@ -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)
};

View File

@@ -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 {}",