Skip to content

Commit

Permalink
Fix: Path::tail
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoric committed Oct 10, 2018
1 parent 24774d7 commit 72563ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/binjs_shared/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ impl<I, F> Path<I, F> 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<I, F>] {
if len >= self.len() {
if len < self.len() {
&self.items[self.len() - len..]
} else {
&self.items
Expand Down

0 comments on commit 72563ab

Please sign in to comment.