treewide: format with nightly rustfmt; auto-fix Clippy lints

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: If4fd0511087dbaa65afc56a34d7c2f166a6a6964
This commit is contained in:
raf 2026-02-08 21:18:42 +03:00
commit 3a03cf7b3e
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
26 changed files with 222 additions and 161 deletions

View file

@ -96,8 +96,8 @@ pub async fn upsert(
) -> Result<Channel> {
sqlx::query_as::<_, Channel>(
"INSERT INTO channels (project_id, name, jobset_id) VALUES ($1, $2, $3) \
ON CONFLICT (project_id, name) DO UPDATE SET jobset_id = EXCLUDED.jobset_id \
RETURNING *",
ON CONFLICT (project_id, name) DO UPDATE SET jobset_id = \
EXCLUDED.jobset_id RETURNING *",
)
.bind(project_id)
.bind(name)
@ -119,12 +119,14 @@ pub async fn sync_for_project(
let names: Vec<&str> = channels.iter().map(|c| c.name.as_str()).collect();
// Delete channels not in declarative config
sqlx::query("DELETE FROM channels WHERE project_id = $1 AND name != ALL($2::text[])")
.bind(project_id)
.bind(&names)
.execute(pool)
.await
.map_err(CiError::Database)?;
sqlx::query(
"DELETE FROM channels WHERE project_id = $1 AND name != ALL($2::text[])",
)
.bind(project_id)
.bind(&names)
.execute(pool)
.await
.map_err(CiError::Database)?;
// Upsert each channel
for channel in channels {