Refactor multiple if let bindings

Replaces nested `if let` statements with sequential `if let` bindings,
improving readability. This change is applied to `Dumper::log_bound`,
`LambdaCollector::visit_bound`, `Environment::call_object_method`, and
`Environment::call_lambda`.
This commit is contained in:
Michael Schimmel
2026-02-19 23:56:50 +01:00
parent 1331aabbe1
commit 30cd73aa63
3 changed files with 16 additions and 16 deletions
+3 -3
View File
@@ -39,8 +39,9 @@ impl Dumper {
BoundKind::Constant(v) => {
self.log(&format!("Constant: {}", v), node);
// Introspect Closure AST if possible
if let Value::Object(obj) = v {
if let Some(closure) = obj.as_any().downcast_ref::<Closure>() {
if let Value::Object(obj) = v
&& let Some(closure) = obj.as_any().downcast_ref::<Closure>()
{
self.indent += 1;
self.write_indent();
self.output.push_str("--- Specialized Body ---\n");
@@ -58,7 +59,6 @@ impl Dumper {
self.output.push('\n');
}
self.indent -= 1;
}
}
},
BoundKind::Get { addr, name } => self.log(&format!("Get: {} ({:?})", name.name, addr), node),