diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3a48308..97754cc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,7 @@ jobs: run: cargo install cargo-hack --locked - name: cargo hack - run: cargo hack check --feature-powerset --no-dev-deps + run: cargo hack check --feature-powerset --skip serde,full-codecs --depth 4 --no-dev-deps - name: cargo test run: cargo test - name: cargo fmt diff --git a/src/content.rs b/src/content.rs index 2ee6f81..9666bd0 100644 --- a/src/content.rs +++ b/src/content.rs @@ -159,7 +159,7 @@ impl ContentType { /// ``` #[must_use] pub fn as_str(&self) -> &'static str { - match self { + match *self { #[cfg(feature = "json")] Self::Json => "application/json", #[cfg(feature = "msgpack")] diff --git a/src/lib.rs b/src/lib.rs index e1d9a05..813277c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,18 @@ #![forbid(unsafe_code)] #![warn(clippy::pedantic)] #![allow(clippy::module_name_repetitions)] +#![cfg_attr( + not(any( + feature = "json", + feature = "msgpack", + feature = "bincode", + feature = "bitcode", + feature = "cbor", + feature = "yaml", + feature = "toml" + )), + allow(unreachable_code, unused_variables) +)] #![doc = include_str!("../README.md")] mod content; diff --git a/src/rejection.rs b/src/rejection.rs index de7a7ff..20bf802 100644 --- a/src/rejection.rs +++ b/src/rejection.rs @@ -1,4 +1,8 @@ -use axum::{extract::rejection::BytesRejection, http::StatusCode, response::Response}; +use axum::{ + extract::rejection::BytesRejection, + http::StatusCode, + response::{IntoResponse, Response}, +}; use crate::{ContentType, IntoCodecResponse};