Skip to content

Commit 24bcfe6

Browse files
Auto-format: cargo fmt --all
1 parent b51d241 commit 24bcfe6

File tree

2 files changed

+15
-23
lines changed

2 files changed

+15
-23
lines changed

crates/codegen/src/symboltable.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1984,10 +1984,7 @@ impl SymbolTableBuilder {
19841984
) -> SymbolTableResult {
19851985
// Enter a new TypeParams scope for the bound/default expression
19861986
// This allows the expression to access outer scope symbols
1987-
let in_class = self
1988-
.tables
1989-
.last()
1990-
.is_some_and(|t| t.can_see_class_scope);
1987+
let in_class = self.tables.last().is_some_and(|t| t.can_see_class_scope);
19911988
let line_number = self.line_index_start(expr.range());
19921989
self.enter_scope(scope_name, CompilerScope::TypeParams, line_number);
19931990

crates/vm/src/builtins/genericalias.rs

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,10 @@ impl PyGenericAlias {
155155
let mut parts = Vec::with_capacity(len);
156156
// Use indexed access so list mutation during repr causes IndexError
157157
for i in 0..len {
158-
let item = list.borrow_vec().get(i).cloned().ok_or_else(|| {
159-
vm.new_index_error("list index out of range".to_owned())
160-
})?;
158+
let item =
159+
list.borrow_vec().get(i).cloned().ok_or_else(|| {
160+
vm.new_index_error("list index out of range".to_owned())
161+
})?;
161162
parts.push(repr_item(item, vm)?);
162163
}
163164
Ok(format!("[{}]", parts.join(", ")))
@@ -251,21 +252,15 @@ impl PyGenericAlias {
251252
}
252253
.into_pyobject(vm);
253254
Ok(PyTuple::new_ref(
254-
vec![
255-
next_fn,
256-
PyTuple::new_ref(vec![iter_obj], &vm.ctx).into(),
257-
],
255+
vec![next_fn, PyTuple::new_ref(vec![iter_obj], &vm.ctx).into()],
258256
&vm.ctx,
259257
))
260258
} else {
261259
Ok(PyTuple::new_ref(
262260
vec![
263261
vm.ctx.types.generic_alias_type.to_owned().into(),
264-
PyTuple::new_ref(
265-
vec![zelf.origin.clone(), zelf.args.clone().into()],
266-
&vm.ctx,
267-
)
268-
.into(),
262+
PyTuple::new_ref(vec![zelf.origin.clone(), zelf.args.clone().into()], &vm.ctx)
263+
.into(),
269264
],
270265
&vm.ctx,
271266
))
@@ -619,13 +614,13 @@ impl Comparable for PyGenericAlias {
619614
return Ok(PyComparisonValue::Implemented(false));
620615
}
621616
Ok(PyComparisonValue::Implemented(
622-
zelf.__origin__().rich_compare_bool(
623-
&other.__origin__(),
624-
PyComparisonOp::Eq,
625-
vm,
626-
)? && zelf
627-
.__args__()
628-
.rich_compare_bool(&other.__args__(), PyComparisonOp::Eq, vm)?,
617+
zelf.__origin__()
618+
.rich_compare_bool(&other.__origin__(), PyComparisonOp::Eq, vm)?
619+
&& zelf.__args__().rich_compare_bool(
620+
&other.__args__(),
621+
PyComparisonOp::Eq,
622+
vm,
623+
)?,
629624
))
630625
})
631626
}

0 commit comments

Comments
 (0)