Skip to content

Commit 9ac6fdb

Browse files
Chore: Address linter warnings.
1 parent 811c636 commit 9ac6fdb

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

compiler/src/modules/parser/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ JoinNode
159159
Tracks SSA versions before/after branches to insert correct PHI nodes later.
160160
*/
161161

162-
pub(super) struct JoinNode {
162+
pub(crate) struct JoinNode {
163163
pub(super) backup: HashMap<String, u32>,
164164
pub(super) then: Option<HashMap<String, u32>>,
165165
}

compiler/src/modules/vm/mod.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -601,17 +601,18 @@ impl<'a> VM<'a> {
601601
for (i, param) in params[pi..].iter().enumerate() {
602602
if let Some(&dv) = captured_defaults.get(d_start + i) {
603603
let pname = format!("{}_0", param.trim_start_matches('*'));
604-
if let Some(&s) = body_map.get(pname.as_str()) {
605-
if fn_slots[s].is_none() { fn_slots[s] = Some(dv); }
604+
if let Some(&s) = body_map.get(pname.as_str()) && fn_slots[s].is_none() {
605+
fn_slots[s] = Some(dv);
606606
}
607607
}
608608
}
609609
}
610610
for (si, sv) in slots.iter().enumerate() {
611-
if let Some(v) = sv {
612-
if let Some(&bs) = body_map.get(chunk.names[si].as_str()) {
613-
if fn_slots[bs].is_none() { fn_slots[bs] = Some(*v); }
614-
}
611+
if let Some(v) = sv
612+
&& let Some(&bs) = body_map.get(chunk.names[si].as_str())
613+
&& fn_slots[bs].is_none()
614+
{
615+
fn_slots[bs] = Some(*v);
615616
}
616617
}
617618
// Inject callee into body slots so the function can call itself by name
@@ -620,8 +621,8 @@ impl<'a> VM<'a> {
620621
let raw = &self.chunk.names[name_idx as usize];
621622
let base = raw.rfind('_').filter(|&p| raw[p+1..].parse::<u32>().is_ok()).map(|p| &raw[..p]).unwrap_or(raw.as_str());
622623
let versioned = format!("{}_0", base);
623-
if let Some(&slot) = body_map.get(versioned.as_str()) {
624-
if fn_slots[slot].is_none() { fn_slots[slot] = Some(callee); }
624+
if let Some(&slot) = body_map.get(versioned.as_str()) && fn_slots[slot].is_none() {
625+
fn_slots[slot] = Some(callee);
625626
}
626627
}
627628

0 commit comments

Comments
 (0)