From a55e883eda1a90c1919086baebe65b0e9c6d4971 Mon Sep 17 00:00:00 2001 From: Oleksandr Kozachuk Date: Fri, 16 Dec 2022 20:55:23 +0100 Subject: [PATCH] Move LKEval::news to test section, to avoid unused warning. --- src/repl.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/repl.rs b/src/repl.rs index 82e110b..bbe82f9 100644 --- a/src/repl.rs +++ b/src/repl.rs @@ -89,14 +89,6 @@ impl<'a> LKEval<'a> { } } - pub fn news(cmd: Command<'a>, state: Rc>) -> Self { - Self { - cmd, - state, - read_password: |_| Err(std::io::Error::new(std::io::ErrorKind::NotConnected, "could not read password")), - } - } - fn get_password(&self, name: &String) -> Option { match self.state.borrow().db.get(name) { Some(pwd) => Some(pwd.clone()), @@ -321,6 +313,16 @@ mod tests { use chrono::naive::NaiveDate; use std::collections::HashMap; + impl<'a> LKEval<'a> { + pub fn news(cmd: Command<'a>, state: Rc>) -> Self { + Self { + cmd, + state, + read_password: |_| Err(std::io::Error::new(std::io::ErrorKind::NotConnected, "could not read password")), + } + } + } + #[test] fn exec_cmds_basic() { let lk = Rc::new(RefCell::new(LK::new()));