diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 2bc3487..42d6d2d 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -50,3 +50,16 @@ jobs: - run: rustup component add rustfmt --toolchain nightly-x86_64-unknown-linux-gnu - name: fmt check run: cargo fmt --all -- --check + + clippy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: Swatinem/rust-cache@v1.2.0 + - uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + override: true + - run: rustup component add clippy + - name: Clippy check + run: cargo clippy -- -D warnings diff --git a/src/error.rs b/src/error.rs index ff8845e..5d13ba9 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,19 +1,18 @@ use http_body_util::combinators::BoxBody; use http_body_util::BodyExt; use hyper::body::Bytes; -use hyper::header::{HeaderValue, ACCESS_CONTROL_ALLOW_ORIGIN}; use hyper::{Response, StatusCode}; use crate::{empty, full}; #[derive(Debug)] +#[allow(clippy::enum_variant_names)] pub(crate) enum Error { BadGateway, MethodNotAllowed, UnsupportedMediaType, BadRequest(String), NotFound, - #[allow(clippy::enum_variant_names)] InternalServerError, }