diff options
Diffstat (limited to 'src/visited.rs')
-rw-r--r-- | src/visited.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/visited.rs b/src/visited.rs index 0832f77..a42099b 100644 --- a/src/visited.rs +++ b/src/visited.rs @@ -19,8 +19,9 @@ impl History { /// Add a new path in the stack, without duplicates, and select the last /// one. pub fn push(&mut self, path: &std::path::Path) { - if !self.content.contains(&path.to_path_buf()) { - self.content.push(path.to_path_buf()); + let path = path.to_path_buf(); + if !self.content.contains(&path) { + self.content.push(path); self.index = self.len() - 1 } } |