summaryrefslogtreecommitdiffstats
path: root/src/visited.rs
diff options
context:
space:
mode:
authorqkzk <qu3nt1n@gmail.com>2022-12-30 21:19:38 +0100
committerqkzk <qu3nt1n@gmail.com>2022-12-30 21:19:38 +0100
commit6403a6d69fde23c6e3a0c761b693f42b83420417 (patch)
tree74baf8e8b2ad4c06409bd1961991463683ad9aa5 /src/visited.rs
parentd2e750a9741bdc2b8cca5ff8bf7124c25c65c121 (diff)
refresh view also refresh users cachecache-users
Diffstat (limited to 'src/visited.rs')
-rw-r--r--src/visited.rs5
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
}
}