Skip to content

Commit

Permalink
fix: ensure at least one required feature is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
matteopolak committed Jul 17, 2024
1 parent 3487a5e commit ec4185d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
12 changes: 12 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
6 changes: 5 additions & 1 deletion src/rejection.rs
Original file line number Diff line number Diff line change
@@ -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};

Expand Down

0 comments on commit ec4185d

Please sign in to comment.