diff options
author | qkzk <qu3nt1n@gmail.com> | 2022-12-29 23:41:01 +0100 |
---|---|---|
committer | qkzk <qu3nt1n@gmail.com> | 2022-12-30 08:57:26 +0100 |
commit | 54ae60bcc89e0a9b56babbb65b0c6a0136fa43c5 (patch) | |
tree | a407c94fb14b8bf24942760b5eca59fda86334ae /src/visited.rs | |
parent | bbf04830089818ffef0bd8216508b41f311493bb (diff) |
use &path more often
Diffstat (limited to 'src/visited.rs')
-rw-r--r-- | src/visited.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/visited.rs b/src/visited.rs index e51cb4c..0832f77 100644 --- a/src/visited.rs +++ b/src/visited.rs @@ -18,9 +18,9 @@ pub struct History { impl History { /// Add a new path in the stack, without duplicates, and select the last /// one. - pub fn push(&mut self, path: &PathBuf) { - if !self.content.contains(path) { - self.content.push(path.to_owned()); + pub fn push(&mut self, path: &std::path::Path) { + if !self.content.contains(&path.to_path_buf()) { + self.content.push(path.to_path_buf()); self.index = self.len() - 1 } } |