diff --git a/crates/binjs_shared/src/ast.rs b/crates/binjs_shared/src/ast.rs index 0bacec998..1a3269d98 100644 --- a/crates/binjs_shared/src/ast.rs +++ b/crates/binjs_shared/src/ast.rs @@ -161,7 +161,7 @@ impl Path where I: Debug + PartialEq, F: Debug + PartialEq { /// If there are fewer than `len` elements, return /// as many elements as possible. pub fn tail(&self, len: usize) -> &[PathItem] { - if len >= self.len() { + if len < self.len() { &self.items[self.len() - len..] } else { &self.items