From 54ae60bcc89e0a9b56babbb65b0c6a0136fa43c5 Mon Sep 17 00:00:00 2001 From: qkzk Date: Thu, 29 Dec 2022 23:41:01 +0100 Subject: use &path more often --- src/visited.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/visited.rs') 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 } } -- cgit v1.2.3