Move LKEval::news to test section, to avoid unused warning.

This commit is contained in:
Oleksandr Kozachuk
2022-12-16 20:55:23 +01:00
parent cd82806ee1
commit a55e883eda
+10 -8
View File
@@ -89,14 +89,6 @@ impl<'a> LKEval<'a> {
}
}
pub fn news(cmd: Command<'a>, state: Rc<RefCell<LK>>) -> 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<PasswordRef> {
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<RefCell<LK>>) -> 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()));