diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 58125bb..ac35284 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -15,6 +15,19 @@ concurrency: cancel-in-progress: true jobs: + format: + name: Format check + runs-on: ubuntu-latest + 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);