From 40f5ae50a9dc45fe88caaed6fc63e889683b4494 Mon Sep 17 00:00:00 2001 From: Daniel von Atzigen Date: Wed, 20 Nov 2024 10:51:15 +0100 Subject: [PATCH] Treat Rust warnings as errors in code quality workflow --- .github/workflows/code-quality.yml | 3 +++ api/src/handlers.rs | 2 +- api/src/lib.rs | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index d7ff5d52f..49e36b12e 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -253,6 +253,9 @@ jobs: cd api cargo fmt --check - name: Run clippy + env: + # Treat warnings as errors + RUSTFLAGS: "-D warnings" run: | cd api cargo clippy --frozen --quiet diff --git a/api/src/handlers.rs b/api/src/handlers.rs index ca930143d..6b179b539 100644 --- a/api/src/handlers.rs +++ b/api/src/handlers.rs @@ -87,7 +87,7 @@ pub struct Member { #[allow(non_snake_case)] #[serde(rename_all = "camelCase")] pub struct Geometry { - #[serde(rename="type")] + #[serde(rename = "type")] typ: String, positions: Vec, id: Option, diff --git a/api/src/lib.rs b/api/src/lib.rs index c3f8690bc..064f83408 100644 --- a/api/src/lib.rs +++ b/api/src/lib.rs @@ -9,7 +9,7 @@ use axum::{ use clap::Parser; use hyper::header::{ACCEPT, AUTHORIZATION, CONTENT_TYPE}; use sqlx::PgPool; -use tower::{ServiceBuilder}; +use tower::ServiceBuilder; use tower_http::{cors::CorsLayer, trace::TraceLayer}; pub use config::Config;