style: cargo fmt --all
Apply rustfmt (toolchain 1.96.0) to satisfy the CI Format check. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
@@ -10,7 +10,11 @@ use sqlx::{PgPool, Row};
|
||||
use crate::DbError;
|
||||
|
||||
/// Replace a node's reported tool versions with `tools` (tool, version).
|
||||
pub async fn upsert(pool: &PgPool, node_id: NodeId, tools: &[(String, String)]) -> Result<(), DbError> {
|
||||
pub async fn upsert(
|
||||
pool: &PgPool,
|
||||
node_id: NodeId,
|
||||
tools: &[(String, String)],
|
||||
) -> Result<(), DbError> {
|
||||
for (tool, version) in tools {
|
||||
sqlx::query(
|
||||
"INSERT INTO node_tools (node_id, tool, version, updated_at)
|
||||
@@ -59,6 +63,11 @@ pub async fn all_latest(pool: &PgPool) -> Result<HashMap<String, String>, DbErro
|
||||
.await?;
|
||||
Ok(rows
|
||||
.into_iter()
|
||||
.map(|r| (r.get::<String, _>("tool"), r.get::<String, _>("latest_version")))
|
||||
.map(|r| {
|
||||
(
|
||||
r.get::<String, _>("tool"),
|
||||
r.get::<String, _>("latest_version"),
|
||||
)
|
||||
})
|
||||
.collect())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user