Merge pull request #7 from ItsEthra/cfg-badges

Generate docs with cfg badges using nightly compiler
This commit is contained in:
Rob 2023-11-30 11:55:58 -05:00 committed by GitHub
commit 02cb1e64c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 0 deletions

View file

@ -12,6 +12,7 @@ edition = "2021"
[features]
default = []
unstable = []
guards = ["tower", "futures-core", "pin-project-lite"]
serde = ["dep:serde", "dep:serde_json"]
@ -26,3 +27,6 @@ pin-project-lite = { version = "0.2", optional = true }
# Optional dependencies required for the `serde` feature.
serde = { version = "1", features = ["derive"], optional = true }
serde_json = { version = "1", optional = true }
[package.metadata.docs.rs]
all-features = true

View file

@ -51,6 +51,7 @@ impl<'a, S> Layer<S> for HxRequestGuardLayer<'a> {
}
}
/// Tower service that implementes redirecting to non-partial routes.
#[derive(Debug, Clone)]
pub struct HxRequestGuard<'a, S> {
inner: S,

View file

@ -1,13 +1,17 @@
#![cfg_attr(feature = "unstable", feature(doc_cfg))]
#![doc = include_str!("../README.md")]
#![forbid(unsafe_code)]
pub mod extractors;
#[cfg(feature = "guards")]
#[cfg_attr(feature = "unstable", doc(cfg(feature = "guards")))]
pub mod guard;
pub mod headers;
pub mod responders;
pub use extractors::*;
#[cfg(feature = "guards")]
#[cfg_attr(feature = "unstable", doc(cfg(feature = "guards")))]
pub use guard::*;
pub use headers::*;
pub use responders::*;

View file

@ -10,6 +10,7 @@ use axum::{
use crate::headers;
#[cfg(feature = "serde")]
#[cfg_attr(feature = "unstable", doc(cfg(feature = "serde")))]
pub mod serde;
const HX_SWAP_INNER_HTML: &str = "innerHTML";