From c9016ee662db216c0aeb205f35d20c6ae70e831c Mon Sep 17 00:00:00 2001 From: pjh456 <147148383@qq.com> Date: Tue, 30 Jun 2026 20:49:56 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E8=87=AA=E5=8A=A8=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/oxide_compiler/src/compiler.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/crates/oxide_compiler/src/compiler.rs b/crates/oxide_compiler/src/compiler.rs index 6292af6f..84e6d516 100644 --- a/crates/oxide_compiler/src/compiler.rs +++ b/crates/oxide_compiler/src/compiler.rs @@ -922,7 +922,9 @@ impl Compiler { if matches!(body_context, FunctionBodyContext::Ordinary | FunctionBodyContext::Arrow) { let (captures, _cells) = self.analyze_upvalue_captures(body_stmts, parent_ctx, &ctx.scopes.symbols); ctx.current_upvalue_captures = captures; - ctx.scopes.cell_registry = ctx.current_upvalue_captures.iter() + ctx.scopes.cell_registry = ctx + .current_upvalue_captures + .iter() .map(|u| (u.name.clone(), u.cell_idx)) .collect(); for up in &ctx.current_upvalue_captures { @@ -1088,7 +1090,9 @@ impl Compiler { is_derived_constructor: false, needs_home_object: false, upvalue_captures: Vec::new(), - cells_needed: ctx.scopes.symbols.scopes[0].bindings.values() + cells_needed: ctx.scopes.symbols.scopes[0] + .bindings + .values() .filter(|b| b.is_captured.get()) .count() as u8, }) @@ -1190,7 +1194,9 @@ impl Compiler { is_derived_constructor: false, needs_home_object: false, upvalue_captures: Vec::new(), - cells_needed: ctx.scopes.symbols.scopes[0].bindings.values() + cells_needed: ctx.scopes.symbols.scopes[0] + .bindings + .values() .filter(|b| b.is_captured.get()) .count() as u8, })