Explorar el Código

ci: treat clippy lints as errors (#16)

* fix: clippy lint

* ci: treat clippy as errors
Yujia Qiao hace 4 años
padre
commit
65c75da633
Se han modificado 2 ficheros con 4 adiciones y 2 borrados
  1. 1 1
      .github/workflows/rust.yml
  2. 3 1
      src/main.rs

+ 1 - 1
.github/workflows/rust.yml

@@ -23,7 +23,7 @@ jobs:
         components: clippy
     - uses: Swatinem/rust-cache@v1
     - name: Clippy
-      run: cargo clippy
+      run: cargo clippy -- -D warnings
     - name: Build
       run: cargo build --verbose
     - name: Build with features

+ 3 - 1
src/main.rs

@@ -24,7 +24,9 @@ async fn main() -> Result<()> {
 
     let level = "info"; // if RUST_LOG not present, use `info` level
     tracing_subscriber::fmt()
-        .with_env_filter(EnvFilter::try_from_default_env().unwrap_or(EnvFilter::from(level)))
+        .with_env_filter(
+            EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::from(level)),
+        )
         .init();
 
     run(&args, shutdown_rx).await