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? {
|
while let Some(row) = results.try_next().await? {
|
||||||
let display_name = row.get::<String, _>("display_name");
|
let display_name = row.get::<String, _>("display_name");
|
||||||
if display_name != current_group {
|
if display_name != current_group {
|
||||||
if current_group != "" {
|
if !current_group.is_empty() {
|
||||||
groups.push(Group {
|
groups.push(Group {
|
||||||
display_name: current_group,
|
display_name: current_group,
|
||||||
users: current_users,
|
users: current_users,
|
||||||
@ -232,9 +232,11 @@ mod tests {
|
|||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_bind_admin() {
|
async fn test_bind_admin() {
|
||||||
let sql_pool = get_in_memory_db().await;
|
let sql_pool = get_in_memory_db().await;
|
||||||
let mut config = Configuration::default();
|
let config = Configuration {
|
||||||
config.ldap_user_dn = "admin".to_string();
|
ldap_user_dn: "admin".to_string(),
|
||||||
config.ldap_user_pass = "test".to_string();
|
ldap_user_pass: "test".to_string(),
|
||||||
|
..Default::default()
|
||||||
|
};
|
||||||
let handler = SqlBackendHandler::new(config, sql_pool);
|
let handler = SqlBackendHandler::new(config, sql_pool);
|
||||||
handler
|
handler
|
||||||
.bind(BindRequest {
|
.bind(BindRequest {
|
||||||
|
@ -101,13 +101,13 @@ fn convert_filter(filter: &LdapFilter) -> Result<RequestFilter> {
|
|||||||
match filter {
|
match filter {
|
||||||
LdapFilter::And(filters) => Ok(RequestFilter::And(
|
LdapFilter::And(filters) => Ok(RequestFilter::And(
|
||||||
filters
|
filters
|
||||||
.into_iter()
|
.iter()
|
||||||
.map(convert_filter)
|
.map(convert_filter)
|
||||||
.collect::<Result<_>>()?,
|
.collect::<Result<_>>()?,
|
||||||
)),
|
)),
|
||||||
LdapFilter::Or(filters) => Ok(RequestFilter::Or(
|
LdapFilter::Or(filters) => Ok(RequestFilter::Or(
|
||||||
filters
|
filters
|
||||||
.into_iter()
|
.iter()
|
||||||
.map(convert_filter)
|
.map(convert_filter)
|
||||||
.collect::<Result<_>>()?,
|
.collect::<Result<_>>()?,
|
||||||
)),
|
)),
|
||||||
|
Loading…
Reference in New Issue
Block a user