Formatting

This commit is contained in:
Michael Schimmel
2026-03-02 23:13:36 +01:00
parent 5bc69c267b
commit 2eb7a2e136
22 changed files with 3212 additions and 2813 deletions
+21 -6
View File
@@ -386,7 +386,11 @@ impl Optimizer {
)
}
BoundKind::Pipe { inputs, lambda, out_type } => {
BoundKind::Pipe {
inputs,
lambda,
out_type,
} => {
let mut o_inputs = Vec::with_capacity(inputs.len());
for input in inputs {
o_inputs.push(self.visit_node(input, sub, path));
@@ -559,17 +563,28 @@ impl Optimizer {
.collect();
(BoundKind::Tuple { elements }, node.ty.clone())
}
BoundKind::Record { ref layout, ref values } => {
BoundKind::Record {
ref layout,
ref values,
} => {
let mapped_values: Vec<_> = values
.iter()
.map(|v| self.visit_node(v.clone(), sub, path))
.collect();
if self.enabled && let Some(folded) = folder.try_fold_record(layout, &mapped_values, &node) {
if self.enabled
&& let Some(folded) = folder.try_fold_record(layout, &mapped_values, &node)
{
return folded;
}
(BoundKind::Record { layout: layout.clone(), values: mapped_values }, node.ty.clone())
(
BoundKind::Record {
layout: layout.clone(),
values: mapped_values,
},
node.ty.clone(),
)
}
BoundKind::Expansion {
ref original_call,
+1 -1
View File
@@ -1,6 +1,6 @@
use crate::ast::compiler::bound_nodes::{Address, AnalyzedNode, BoundKind, NodeMetrics};
use crate::ast::nodes::Node;
use crate::ast::types::{Purity, StaticType, Value, RecordLayout};
use crate::ast::types::{Purity, RecordLayout, StaticType, Value};
use std::cell::RefCell;
use std::rc::Rc;
+4 -1
View File
@@ -158,7 +158,10 @@ impl UsageInfo {
}
self.collect(lambda);
}
BoundKind::Nop | BoundKind::FieldAccessor(_) | BoundKind::Extension(_) | BoundKind::Error => {}
BoundKind::Nop
| BoundKind::FieldAccessor(_)
| BoundKind::Extension(_)
| BoundKind::Error => {}
}
}