From 25c85fe076fccff8f10403be435bdbcec766fe92 Mon Sep 17 00:00:00 2001 From: daragh Date: Sun, 18 Feb 2024 00:37:28 +0000 Subject: [PATCH 1/2] fix : clippy --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index fcbc117..0b3791a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -283,7 +283,7 @@ pub fn uid_to_dn(uid: &str) -> String { format!("uid={},ou=users,dc=skynet,dc=ie", uid) } -pub async fn update_group(config: &Config, group: &str, users: &Vec, replace: bool) -> tide::Result<()> { +pub async fn update_group(config: &Config, group: &str, users: &[String], replace: bool) -> tide::Result<()> { if users.is_empty() { return Ok(()); } From 05e99203e80a1369da8bb4caf0e9b2a65e80248b Mon Sep 17 00:00:00 2001 From: daragh Date: Sun, 18 Feb 2024 00:39:39 +0000 Subject: [PATCH 2/2] fix : clippy --- src/methods/account_new.rs | 2 +- src/methods/account_update.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/methods/account_new.rs b/src/methods/account_new.rs index 73d05f3..53573a0 100644 --- a/src/methods/account_new.rs +++ b/src/methods/account_new.rs @@ -421,7 +421,7 @@ pub mod account { ldap.extended(tmp).unwrap(); // user is already verified by being an active member on wolves - if let Err(e) = update_group(config, "skynet-users", &vec![username.to_string()], false).await { + if let Err(e) = update_group(config, "skynet-users", &[username.to_string()], false).await { println!("Couldnt add {} to skynet-users: {:?}", username, e) } diff --git a/src/methods/account_update.rs b/src/methods/account_update.rs index 6c95903..266f7ca 100644 --- a/src/methods/account_update.rs +++ b/src/methods/account_update.rs @@ -87,7 +87,7 @@ async fn activate_group(db: &Pool, config: &Config, user: &str, mail: &s // check if user has this mail in teh wolves db if !get_wolves_mail(db, mail).await.is_empty() { // if so then activate - if let Err(e) = update_group(config, "skynet-users", &vec![user.to_string()], false).await { + if let Err(e) = update_group(config, "skynet-users", &[user.to_string()], false).await { println!("Couldnt add {} to skynet-users: {:?}", user, e) } }