Skip to content

Commit b8d7e6c

Browse files
sypharGuillaumeGomez
authored andcommitted
reduce dependencies in headers-subcrate
1 parent c885019 commit b8d7e6c

File tree

8 files changed

+12
-10
lines changed

8 files changed

+12
-10
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/lib/docs_rs_headers/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,19 @@ edition = "2024"
55

66
[dependencies]
77
anyhow = { workspace = true }
8-
axum-core = "0.5.5"
9-
axum-extra = { workspace = true }
108
askama = { workspace = true }
9+
axum-core = "0.5.5"
1110
derive_more = { workspace = true }
1211
docs_rs_types = { path = "../docs_rs_types" }
1312
docs_rs_uri = { path = "../docs_rs_uri" }
13+
headers = "0.4.1"
1414
http = { workspace = true }
1515
itertools = { workspace = true }
1616
md5 = "0.8.0"
1717
serde = { workspace = true }
1818

1919
[dev-dependencies]
20+
axum-extra = { workspace = true }
2021
serde_json = { workspace = true }
2122
test-case = { workspace = true }
2223
tokio = { workspace = true }

crates/lib/docs_rs_headers/src/canonical_url.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use anyhow::Result;
22
use askama::filters::HtmlSafe;
3-
use axum_extra::headers::{Header, HeaderName, HeaderValue};
43
use docs_rs_uri::EscapedURI;
4+
use headers::{Header, HeaderName, HeaderValue};
55
use http::uri::Uri;
66
use serde::Serialize;
77
use std::{fmt, ops::Deref};
@@ -39,7 +39,7 @@ impl Header for CanonicalUrl {
3939
&http::header::LINK
4040
}
4141

42-
fn decode<'i, I>(_values: &mut I) -> Result<Self, axum_extra::headers::Error>
42+
fn decode<'i, I>(_values: &mut I) -> Result<Self, headers::Error>
4343
where
4444
I: Iterator<Item = &'i HeaderValue>,
4545
{

crates/lib/docs_rs_headers/src/etag.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use axum_extra::headers::ETag;
1+
use headers::ETag;
22
use std::io::{self, Write};
33

44
/// compute our etag header value from some content

crates/lib/docs_rs_headers/src/if_none_match.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
2525
#[allow(clippy::disallowed_types)]
2626
mod header_impl {
27-
use axum_extra::headers::{self, ETag, Header, IfNoneMatch as OriginalIfNoneMatch};
2827
use derive_more::Deref;
28+
use headers::{self, ETag, Header, IfNoneMatch as OriginalIfNoneMatch};
2929

3030
#[derive(Debug, Clone, PartialEq, Deref)]
31-
pub struct IfNoneMatch(pub axum_extra::headers::IfNoneMatch);
31+
pub struct IfNoneMatch(pub headers::IfNoneMatch);
3232

3333
impl Header for IfNoneMatch {
3434
fn name() -> &'static http::HeaderName {

crates/lib/docs_rs_headers/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ mod surrogate_key;
55
#[cfg(test)]
66
mod testing;
77

8-
pub use axum_extra::headers::ETag;
98
pub use canonical_url::CanonicalUrl;
109
pub use etag::{ETagComputer, compute_etag};
10+
pub use headers::ETag;
1111
pub use if_none_match::IfNoneMatch;
1212
pub use surrogate_key::{SURROGATE_KEY, SurrogateKey, SurrogateKeys};
1313

crates/lib/docs_rs_headers/src/surrogate_key.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
//! https://www.fastly.com/documentation/reference/http/http-headers/Surrogate-Key/haeders.surrogate keys
44
55
use anyhow::{Context as _, bail};
6-
use axum_extra::headers::{self, Header};
76
use derive_more::Deref;
87
use docs_rs_types::KrateName;
8+
use headers::{self, Header};
99
use http::{HeaderName, HeaderValue};
1010
use itertools::Itertools as _;
1111
use std::{collections::BTreeSet, fmt::Display, iter, str::FromStr};

crates/lib/docs_rs_headers/src/testing.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use axum_extra::headers::{self, Header, HeaderMapExt};
1+
use headers::{self, Header, HeaderMapExt};
22
use http::{HeaderMap, HeaderValue};
33

44
pub(crate) fn test_typed_decode<H, V>(value: V) -> Result<Option<H>, headers::Error>

0 commit comments

Comments
 (0)