Skip to content

Commit 29b9fa4

Browse files
authored
Merge pull request #2 from utterstep/axum-0.8
Axum 0.8
2 parents fc3cc38 + c5404b3 commit 29b9fa4

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

packages/axum-helmet/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ categories = ["web-programming", "http", "middleware"]
1414
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1515

1616
[dependencies]
17-
axum = "0.7"
17+
axum = "0.8"
1818
helmet-core = { path = "../helmet-core", version = "0.1.0" }
19-
tower = "0.4"
19+
tower = "0.5"
2020
tower-service = "0.3"
2121
http = "1.0"
2222
pin-project-lite = "0.2"
2323
tokio = "1.35"
2424

2525
[dev-dependencies]
26-
axum-test = "14.2"
26+
axum-test = "17.2"
2727
tokio = { version = "1.35", features = ["rt-multi-thread"] }

packages/helmet-core/src/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,7 +1391,7 @@ impl<'a> ContentSecurityPolicy<'a> {
13911391
}
13921392
}
13931393

1394-
impl<'a> Display for ContentSecurityPolicy<'a> {
1394+
impl Display for ContentSecurityPolicy<'_> {
13951395
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13961396
let directives = self
13971397
.directives
@@ -1403,7 +1403,7 @@ impl<'a> Display for ContentSecurityPolicy<'a> {
14031403
}
14041404
}
14051405

1406-
impl<'a> Default for ContentSecurityPolicy<'a> {
1406+
impl Default for ContentSecurityPolicy<'_> {
14071407
/// Default policy for the Content-Security-Policy header.
14081408
///
14091409
/// values:
@@ -1436,7 +1436,7 @@ impl<'a> Default for ContentSecurityPolicy<'a> {
14361436
}
14371437
}
14381438

1439-
impl<'a> Header for ContentSecurityPolicy<'a> {
1439+
impl Header for ContentSecurityPolicy<'_> {
14401440
fn name(&self) -> &'static str {
14411441
if self.report_only {
14421442
"Content-Security-Policy-Report-Only"
@@ -1472,6 +1472,7 @@ pub struct Helmet {
14721472
pub headers: Vec<Box<dyn Header>>,
14731473
}
14741474

1475+
#[allow(clippy::should_implement_trait)]
14751476
impl Helmet {
14761477
/// Create new `Helmet` instance without any headers applied
14771478
pub fn new() -> Self {

packages/ntex-helmet/src/lib.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,11 @@ where
102102
{
103103
type Response = WebResponse;
104104
type Error = S::Error;
105-
type Future<'f> =
106-
BoxFuture<'f, Result<Self::Response, Self::Error>> where S: 'f, E: 'f;
105+
type Future<'f>
106+
= BoxFuture<'f, Result<Self::Response, Self::Error>>
107+
where
108+
S: 'f,
109+
E: 'f;
107110

108111
forward_poll_ready!(service);
109112
forward_poll_shutdown!(service);
@@ -126,8 +129,10 @@ where
126129
/// ```rust
127130
/// use ntex::web;
128131
/// use ntex_helmet::Helmet;
132+
#[derive(Default)]
129133
pub struct Helmet(HelmetCore);
130134

135+
#[allow(clippy::should_implement_trait)]
131136
impl Helmet {
132137
pub fn new() -> Self {
133138
Self(HelmetCore::new())
@@ -138,12 +143,6 @@ impl Helmet {
138143
}
139144
}
140145

141-
impl Default for Helmet {
142-
fn default() -> Self {
143-
Self(HelmetCore::default())
144-
}
145-
}
146-
147146
impl<S> Middleware<S> for Helmet {
148147
type Service = HelmetMiddleware<S>;
149148

0 commit comments

Comments
 (0)