diff --git a/server/tests/common/auth.rs b/server/tests/common/auth.rs index 4e966f4..0bcaf3e 100644 --- a/server/tests/common/auth.rs +++ b/server/tests/common/auth.rs @@ -10,8 +10,8 @@ pub fn get_token(client: &Client) -> String { .header(reqwest::header::CONTENT_TYPE, "application/json") .body( serde_json::to_string(&lldap_auth::login::ClientSimpleLoginRequest { - username: username, - password: password, + username, + password, }) .expect("Failed to encode the username/password as json to log in"), ) diff --git a/server/tests/common/env.rs b/server/tests/common/env.rs index 7d17ced..f377887 100644 --- a/server/tests/common/env.rs +++ b/server/tests/common/env.rs @@ -5,7 +5,7 @@ pub const DB_KEY: &str = "LLDAP_DATABASE_URL"; pub fn database_url() -> String { let url = var(DB_KEY).ok(); let url = url.unwrap_or("sqlite://e2e_test.db?mode=rwc".to_string()); - url.to_string() + url } pub fn ldap_url() -> String { @@ -27,17 +27,17 @@ pub fn http_url() -> String { pub fn admin_dn() -> String { let user = var("LLDAP_LDAP_USER_DN").ok(); let user = user.unwrap_or("admin".to_string()); - user.to_string() + user } pub fn admin_password() -> String { let pass = var("LLDAP_LDAP_USER_PASS").ok(); let pass = pass.unwrap_or("password".to_string()); - pass.to_string() + pass } pub fn base_dn() -> String { let dn = var("LLDAP_LDAP_BASE_DN").ok(); let dn = dn.unwrap_or("dc=example,dc=com".to_string()); - dn.to_string() + dn } diff --git a/server/tests/common/fixture.rs b/server/tests/common/fixture.rs index 7529a30..eb95b2a 100644 --- a/server/tests/common/fixture.rs +++ b/server/tests/common/fixture.rs @@ -110,18 +110,18 @@ impl LLDAPFixture { self.users.insert(user.clone()); } - fn add_group(&mut self, group: &String) { + fn add_group(&mut self, group: &str) { let id = post::( &self.client, &self.token, create_group::Variables { - name: group.clone(), + name: group.to_owned(), }, ) .expect("failed to add group") .create_group .id; - self.groups.insert(group.clone(), id); + self.groups.insert(group.to_owned(), id); } fn delete_user(&mut self, user: &String) { @@ -147,13 +147,13 @@ impl LLDAPFixture { self.groups.remove(group); } - fn add_user_to_group(&mut self, user: &String, group: &String) { + fn add_user_to_group(&mut self, user: &str, group: &String) { let group_id = self.groups.get(group).unwrap(); post::( &self.client, &self.token, add_user_to_group::Variables { - user: user.clone(), + user: user.to_owned(), group: *group_id, }, )