From 127f386e35c747ae1c34421fda0fdebfceb1435d Mon Sep 17 00:00:00 2001 From: Oleksandr Kozachuk Date: Fri, 6 Jan 2023 15:08:52 +0100 Subject: [PATCH] Fix compilation and tests. --- hel/src/repl.rs | 9 +++++---- hel/src/structs.rs | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/hel/src/repl.rs b/hel/src/repl.rs index 90b65a2..d7140a2 100644 --- a/hel/src/repl.rs +++ b/hel/src/repl.rs @@ -162,6 +162,7 @@ impl PartialEq for LKPrint { #[cfg(test)] mod tests { use super::*; + use std::collections::HashSet; use crate::lk::LK; use crate::password::Password; use crate::structs::Mode; @@ -209,13 +210,13 @@ mod tests { .db .iter() .map(|x| (x.0.to_string(), x.1.lock().borrow().to_string())) - .collect::>(), + .collect::>(), { let mut db = HashMap::new(); db.insert(pwd1.lock().borrow().name.to_string(), pwd1.clone()); db.into_iter() .map(|x| (x.0.to_string(), x.1.lock().borrow().to_string())) - .collect::>() + .collect::>() } ); assert_eq!( @@ -249,12 +250,12 @@ mod tests { .db .iter() .map(|x| (x.0.to_string(), x.1.lock().borrow().to_string())) - .collect::>(), + .collect::>(), { let mut db = HashMap::new(); db.insert(pwd1.lock().borrow().name.to_string(), pwd1.clone()); db.insert(pwd2.lock().borrow().name.to_string(), pwd2.clone()); - db.into_iter().map(|x| (x.0, x.1.lock().borrow().to_string())).collect::>() + db.into_iter().map(|x| (x.0, x.1.lock().borrow().to_string())).collect::>() } ); assert_eq!( diff --git a/hel/src/structs.rs b/hel/src/structs.rs index cbc31cf..7ba4cbb 100644 --- a/hel/src/structs.rs +++ b/hel/src/structs.rs @@ -85,7 +85,7 @@ impl<'a> PartialEq for Command<'a> { fn eq(&self, other: &Self) -> bool { match (self, other) { (Command::Add(s), Command::Add(o)) => *s.lock() == *o.lock(), - (Command::Leave(s), Command::Leave(o)) => s == o, + (Command::Keep(s), Command::Keep(o)) => s == o, (Command::Ls(s), Command::Ls(o)) => s == o, (Command::Ld(s), Command::Ld(o)) => s == o, (Command::Mv(a, b), Command::Mv(x, y)) => a == x && b == y,