Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions httpsig-hyper/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ impl std::str::FromStr for ContentDigestType {
pub use error::{HyperDigestError, HyperDigestResult, HyperSigError, HyperSigResult};
pub use httpsig::prelude;
pub use hyper_content_digest::{ContentDigest, RequestContentDigest, ResponseContentDigest};
pub use hyper_http::{
MessageSignature, MessageSignatureReq, MessageSignatureReqSync, MessageSignatureRes, MessageSignatureResSync,
};
pub use hyper_http::{MessageSignature, MessageSignatureReq, MessageSignatureRes};
#[cfg(feature = "blocking")]
pub use hyper_http::{MessageSignatureReqSync, MessageSignatureResSync};

/* ----------------------------------------------------------------- */
#[cfg(test)]
Expand Down
6 changes: 3 additions & 3 deletions httpsig/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ rust-version.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
default = []
default = ["tracing"]
rsa-signature = ["rsa"]
tracing = ["dep:tracing"]

[dependencies]
thiserror = { version = "2.0.19" }
tracing = { version = "0.1.44" }
tracing = { version = "0.1.44", default-features = false, optional = true }
rustc-hash = { version = "2.1.3" }
indexmap = { version = "2.14.0" }
rand = { version = "0.10.2" }
Expand Down Expand Up @@ -56,4 +57,3 @@ base64 = { version = "0.22.1" }

# for rfc8941 structured field values
sfv = { version = "0.15.0" }

43 changes: 42 additions & 1 deletion httpsig/src/trace.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,43 @@
#[cfg(feature = "tracing")]
#[allow(unused)]
pub use tracing::{debug, error, info, trace, warn};
pub(crate) use tracing::{debug, error, info, trace, warn};

/// No-op macros used when the `tracing` feature is disabled.
/// They expand to `()` so that they are usable both in statement and
/// expression positions, like the original `tracing` macros.
/// `warn` is defined as `warn_` and re-exported, since a macro named
/// `warn` conflicts with the built-in `warn` attribute (E0659).
Comment on lines +8 to +9
#[cfg(not(feature = "tracing"))]
mod noop {
#![allow(unused_macros)]
macro_rules! debug {
($($arg:tt)*) => {
()
};
}
macro_rules! error {
($($arg:tt)*) => {
()
};
}
macro_rules! info {
($($arg:tt)*) => {
()
};
}
macro_rules! trace {
($($arg:tt)*) => {
()
};
}
macro_rules! warn_ {
($($arg:tt)*) => {
()
};
}
#[allow(unused_imports)]
pub(crate) use {debug, error, info, trace, warn_ as warn};
}
#[cfg(not(feature = "tracing"))]
#[allow(unused)]
pub(crate) use noop::*;
Loading