mirror of
https://github.com/nitnelave/lldap.git
synced 2023-04-12 14:25:13 +00:00
clippy fixes
This commit is contained in:
parent
c33948ccc2
commit
5abff453b9
@ -136,7 +136,7 @@ impl BackendHandler for SqlBackendHandler {
|
||||
while let Some(row) = results.try_next().await? {
|
||||
let display_name = row.get::<String, _>("display_name");
|
||||
if display_name != current_group {
|
||||
if current_group != "" {
|
||||
if !current_group.is_empty() {
|
||||
groups.push(Group {
|
||||
display_name: current_group,
|
||||
users: current_users,
|
||||
@ -232,9 +232,11 @@ mod tests {
|
||||
#[tokio::test]
|
||||
async fn test_bind_admin() {
|
||||
let sql_pool = get_in_memory_db().await;
|
||||
let mut config = Configuration::default();
|
||||
config.ldap_user_dn = "admin".to_string();
|
||||
config.ldap_user_pass = "test".to_string();
|
||||
let config = Configuration {
|
||||
ldap_user_dn: "admin".to_string(),
|
||||
ldap_user_pass: "test".to_string(),
|
||||
..Default::default()
|
||||
};
|
||||
let handler = SqlBackendHandler::new(config, sql_pool);
|
||||
handler
|
||||
.bind(BindRequest {
|
||||
|
@ -101,13 +101,13 @@ fn convert_filter(filter: &LdapFilter) -> Result<RequestFilter> {
|
||||
match filter {
|
||||
LdapFilter::And(filters) => Ok(RequestFilter::And(
|
||||
filters
|
||||
.into_iter()
|
||||
.iter()
|
||||
.map(convert_filter)
|
||||
.collect::<Result<_>>()?,
|
||||
)),
|
||||
LdapFilter::Or(filters) => Ok(RequestFilter::Or(
|
||||
filters
|
||||
.into_iter()
|
||||
.iter()
|
||||
.map(convert_filter)
|
||||
.collect::<Result<_>>()?,
|
||||
)),
|
||||
|
Loading…
Reference in New Issue
Block a user