Skip to content

Commit 89dd792

Browse files
committed
refactor(tsconfig): simplify parent traversal with ? operator
1 parent a9391c0 commit 89dd792

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

‎src/transpile/tsconfig.rs‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,13 @@ pub fn find_nearest_tsconfig(
132132
return None;
133133
}
134134

135-
current = match current.parent() {
136-
Some(parent) => {
137-
// Never walk above the stop dir
138-
if !parent.starts_with(stop_dir) && parent != stop_dir {
139-
return None;
140-
}
141-
parent
135+
current = {
136+
let parent = current.parent()?;
137+
// Never walk above the stop dir
138+
if !parent.starts_with(stop_dir) && parent != stop_dir {
139+
return None;
142140
}
143-
None => return None,
141+
parent
144142
};
145143
}
146144
}

0 commit comments

Comments
 (0)