Skip to content

Commit d8a329d

Browse files
committed
fix(extractor): use if-let-else continue in extract_var_init_type outer loop
Replace `declarator.child(i)?` with `let Some(child) = ... else { continue }` to skip None child slots rather than returning None from the entire function. Matches the inner loop pattern and the TypeScript mirror's optional-chaining.
1 parent 3074e93 commit d8a329d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • crates/codegraph-core/src/extractors

crates/codegraph-core/src/extractors/csharp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ fn extract_csharp_base_types(
440440

441441
fn extract_var_init_type(declarator: &Node, source: &[u8]) -> Option<String> {
442442
for i in 0..declarator.child_count() {
443-
let child = declarator.child(i)?;
443+
let Some(child) = declarator.child(i) else { continue };
444444
if child.kind() == "object_creation_expression" {
445445
if let Some(t) = child.child_by_field_name("type") {
446446
return extract_csharp_type_name(&t, source).map(|s| s.to_string());

0 commit comments

Comments
 (0)