Skip to content

Commit

Permalink
fix: fix clippy errors in main
Browse files Browse the repository at this point in the history
  • Loading branch information
NishantJoshi00 committed Oct 30, 2023
1 parent 3a512e6 commit 93d9eb4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Expand Up @@ -6,8 +6,9 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
default = ["kms"]
default = ["kms", "middleware"]
kms = ["dep:aws-config", "dep:aws-sdk-kms"]
middleware = []

[dependencies]
aws-config = { version = "0.55.3", optional = true }
Expand Down
4 changes: 1 addition & 3 deletions src/middleware.rs
Expand Up @@ -69,8 +69,6 @@ pub async fn middleware(
.report_unwrap()?;

Ok(Response::new(
jwe_encrypted
.map_err(|err| axum::Error::new(err))
.boxed_unsync(),
jwe_encrypted.map_err(axum::Error::new).boxed_unsync(),
))
}
7 changes: 4 additions & 3 deletions src/routes/data.rs
Expand Up @@ -18,7 +18,7 @@ use crate::{
};

#[cfg(feature = "middleware")]
use crate::middleware;
use crate::middleware as custom_middleware;

mod transformers;
pub mod types;
Expand All @@ -34,11 +34,12 @@ pub fn serve(#[cfg(feature = "middleware")] state: AppState) -> axum::Router<App

#[cfg(feature = "middleware")]
{
router = router.layer(middleware::from_fn_with_state(
router.layer(middleware::from_fn_with_state(
state,
middleware::middleware,
custom_middleware::middleware,
))
}
#[cfg(not(feature = "middleware"))]
router
}

Expand Down

0 comments on commit 93d9eb4

Please sign in to comment.