Skip to content

Commit af7083f

Browse files
committed
Fix remaining manual error
1 parent 5b09d20 commit af7083f

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

crates/ark/src/lsp/folding_range.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,6 @@ fn nested_processor(
259259
}
260260

261261
let Some((last_level, _)) = comment_stack.last_or_error()?.last() else {
262-
tracing::error!("Folding Range: comment_stacks should not be empty here");
263262
return Err(anyhow::anyhow!("Empty comment stack"));
264263
};
265264

@@ -284,10 +283,7 @@ fn nested_processor(
284283
start_line,
285284
find_last_non_empty_line(document, start_line, line_num - 1),
286285
));
287-
comment_stack
288-
.last_mut()
289-
.ok_or_else(|| anyhow::anyhow!("Empty comment stack"))?
290-
.pop(); // Safe: the loop exits early if the stack becomes empty
286+
comment_stack.last_mut_or_error()?.pop(); // Safe: the loop exits early if the stack becomes empty
291287
},
292288
}
293289
}

0 commit comments

Comments
 (0)