Skip to content

Commit 517bcc1

Browse files
committed
cleanup: fix linting errors
1 parent 7fc0a9e commit 517bcc1

File tree

2 files changed

+21
-12
lines changed

2 files changed

+21
-12
lines changed

server/src/handlers/organization_handler.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,13 @@ pub async fn update_all_org_dataset_configs(
476476
let new_dataset_config = req_payload.to_configuration.clone();
477477
let from_configuration = req_payload.from_configuration.clone();
478478

479-
update_all_org_dataset_configs_query(organization_id, new_dataset_config, from_configuration, pool).await?;
479+
update_all_org_dataset_configs_query(
480+
organization_id,
481+
new_dataset_config,
482+
from_configuration,
483+
pool,
484+
)
485+
.await?;
480486

481487
Ok(HttpResponse::NoContent().finish())
482488
}

server/src/operators/organization_operator.rs

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -997,18 +997,21 @@ pub async fn update_all_org_dataset_configs_query(
997997
);
998998

999999
if let Some(from_config) = from_config {
1000-
let from_config_query = from_config.as_object().unwrap().iter().map(|(key, value)| {
1001-
format!(
1002-
"server_configuration::jsonb->>'{}' = '{}'",
1003-
key,
1004-
value.as_str().unwrap().replace('\'', "''")
1005-
)
1006-
}).collect::<Vec<String>>().join(" AND ");
1000+
let from_config_query = from_config
1001+
.as_object()
1002+
.unwrap()
1003+
.iter()
1004+
.map(|(key, value)| {
1005+
format!(
1006+
"server_configuration::jsonb->>'{}' = '{}'",
1007+
key,
1008+
value.as_str().unwrap().replace('\'', "''")
1009+
)
1010+
})
1011+
.collect::<Vec<String>>()
1012+
.join(" AND ");
10071013

1008-
concat_configs_raw_query.push_str(&format!(
1009-
" AND ({})",
1010-
from_config_query
1011-
));
1014+
concat_configs_raw_query.push_str(&format!(" AND ({})", from_config_query));
10121015
}
10131016

10141017
concat_configs_raw_query.push(';');

0 commit comments

Comments
 (0)