mirror of
https://github.com/lldap/lldap.git
synced 2024-11-25 09:06:03 +00:00
chore: clippy warnings
This commit is contained in:
parent
c4be7f5b6f
commit
8b7852bf1c
4 changed files with 5 additions and 3 deletions
|
@ -48,6 +48,7 @@ pub enum Memberships {
|
|||
GroupId,
|
||||
}
|
||||
|
||||
#[allow(clippy::enum_variant_names)] // The table names are generated from the enum.
|
||||
#[derive(DeriveIden, PartialEq, Eq, Debug, Serialize, Deserialize, Clone, Copy)]
|
||||
pub enum UserAttributeSchema {
|
||||
Table,
|
||||
|
@ -67,6 +68,7 @@ pub enum UserAttributes {
|
|||
UserAttributeValue,
|
||||
}
|
||||
|
||||
#[allow(clippy::enum_variant_names)] // The table names are generated from the enum.
|
||||
#[derive(DeriveIden, PartialEq, Eq, Debug, Serialize, Deserialize, Clone, Copy)]
|
||||
pub enum GroupAttributeSchema {
|
||||
Table,
|
||||
|
|
|
@ -10,7 +10,7 @@ use sea_orm::{
|
|||
use serde::{Deserialize, Serialize};
|
||||
use strum::{EnumString, IntoStaticStr};
|
||||
|
||||
pub use super::model::{GroupColumn, UserColumn};
|
||||
pub use super::model::UserColumn;
|
||||
|
||||
#[derive(PartialEq, Hash, Eq, Clone, Debug, Default, Serialize, Deserialize, DeriveValueType)]
|
||||
#[serde(try_from = "&str")]
|
||||
|
|
|
@ -47,7 +47,7 @@ fn gitea() {
|
|||
let mut found_users: HashSet<String> = HashSet::new();
|
||||
for result in results {
|
||||
let attrs = SearchEntry::construct(result).attrs;
|
||||
let user = attrs.get("uid").unwrap().get(0).unwrap();
|
||||
let user = attrs.get("uid").unwrap().first().unwrap();
|
||||
found_users.insert(user.clone());
|
||||
}
|
||||
assert!(found_users.contains(&gitea_user1));
|
||||
|
|
|
@ -102,7 +102,7 @@ fn get_users_and_groups(results: SearchResult) -> HashMap<String, HashSet<String
|
|||
let mut found_users: HashMap<String, HashSet<String>> = HashMap::new();
|
||||
for result in results {
|
||||
let attrs = SearchEntry::construct(result).attrs;
|
||||
let user = attrs.get("uid").unwrap().get(0).unwrap();
|
||||
let user = attrs.get("uid").unwrap().first().unwrap();
|
||||
let user_groups = attrs.get("memberof").unwrap().clone();
|
||||
let mut groups: HashSet<String> = HashSet::new();
|
||||
groups.extend(user_groups.clone());
|
||||
|
|
Loading…
Reference in a new issue