From 20431706a863f92cb37dc512fef6e48d192aaf2c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:11:38 +0200 Subject: Merging upstream version 1.66.0+dfsg1. Signed-off-by: Daniel Baumann --- vendor/rowan/src/cursor.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vendor/rowan/src/cursor.rs') diff --git a/vendor/rowan/src/cursor.rs b/vendor/rowan/src/cursor.rs index 39b0c9624..671be2348 100644 --- a/vendor/rowan/src/cursor.rs +++ b/vendor/rowan/src/cursor.rs @@ -390,7 +390,7 @@ impl NodeData { } fn prev_sibling(&self) -> Option { let mut rev_siblings = self.green_siblings().enumerate().rev(); - let index = rev_siblings.len() - (self.index() as usize); + let index = rev_siblings.len().checked_sub(self.index() as usize + 1)?; rev_siblings.nth(index); rev_siblings.find_map(|(index, child)| { -- cgit v1.2.3