From 1dd9488f7d9941964366fa1fb24c7f8ea480c41a Mon Sep 17 00:00:00 2001 From: Hugo Caillard <911307+hugocaillard@users.noreply.github.com> Date: Thu, 3 Oct 2024 18:28:35 +0200 Subject: [PATCH] ci: run cargo format --check --- .github/workflows/ci.yaml | 14 ++++++++++++++ src/main.rs | 6 +----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 58125bb..130c598 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -15,6 +15,20 @@ concurrency: cancel-in-progress: true jobs: + audit: + name: Format check + runs-on: ubuntu-latest + needs: pre_run + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Rust toolchain + run: rustup toolchain install stable --profile minimal --component rustfmt + + - name: Run rustfmt + run: cargo fmt --all -- --check + build: runs-on: ubuntu-latest outputs: diff --git a/src/main.rs b/src/main.rs index 584575b..97f179d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -31,11 +31,7 @@ async fn main() { let config_path = match env::var("CONFIG_PATH") { Ok(path) => path, Err(_) => { - if cfg!(debug_assertions) { - "./Config.toml".into() - } else { - "/etc/config/Config.toml".into() - } + if cfg!(debug_assertions) { "./Config.toml".into() } else { "/etc/config/Config.toml".into() } } }; let config = ApiConfig::from_path(&config_path);