Fix tests

This commit is contained in:
Cameron Cordes
2023-03-19 12:29:33 -04:00
parent 8bcd9440bf
commit fbcfc68e01
3 changed files with 29 additions and 24 deletions

View File

@@ -20,7 +20,7 @@ impl TestUserDao {
}
impl UserDao for TestUserDao {
fn create_user(&self, username: &str, password: &str) -> Option<User> {
fn create_user(&mut self, username: &str, password: &str) -> Option<User> {
let u = User {
id: (self.user_map.borrow().len() + 1) as i32,
username: username.to_string(),
@@ -32,7 +32,7 @@ impl UserDao for TestUserDao {
Some(u)
}
fn get_user(&self, user: &str, pass: &str) -> Option<User> {
fn get_user(&mut self, user: &str, pass: &str) -> Option<User> {
match self
.user_map
.borrow()
@@ -47,7 +47,7 @@ impl UserDao for TestUserDao {
}
}
fn user_exists(&self, user: &str) -> bool {
fn user_exists(&mut self, user: &str) -> bool {
self.user_map
.borrow()
.iter()