Skip to content

Commit

Permalink
doc: Show feature badges on docs.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
chyyran committed Aug 5, 2022
1 parent cbb63be commit 8750cb0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cargo.toml
Expand Up @@ -27,3 +27,4 @@ raw_decoder = []

[package.metadata.docs.rs]
features = ["stream", "raw_decoder"]
rustdoc-args = ["--cfg", "docsrs"]
1 change: 1 addition & 0 deletions src/decode/stream.rs
Expand Up @@ -61,6 +61,7 @@ where

/// Lzma decompressor that can process multiple chunks of data using the
/// `io::Write` interface.
#[cfg_attr(docsrs, doc(cfg(stream)))]
pub struct Stream<W>
where
W: Write,
Expand Down
6 changes: 5 additions & 1 deletion src/lib.rs
@@ -1,5 +1,5 @@
//! Pure-Rust codecs for LZMA, LZMA2, and XZ.

#![cfg_attr(docsrs, feature(doc_cfg, doc_cfg_hide))]
#![deny(missing_docs)]
#![deny(missing_debug_implementations)]
#![forbid(unsafe_code)]
Expand All @@ -24,13 +24,17 @@ pub mod compress {
/// Decompression helpers.
pub mod decompress {
pub use crate::decode::options::*;

#[cfg(feature = "raw_decoder")]
#[cfg_attr(docsrs, doc(cfg(raw_decoder)))]
pub mod raw {
//! Raw decoding primitives for LZMA/LZMA2 streams.
pub use crate::decode::lzma::{LzmaDecoder, LzmaParams, LzmaProperties};
pub use crate::decode::lzma2::Lzma2Decoder;
}

#[cfg(feature = "stream")]
#[cfg_attr(docsrs, doc(cfg(stream)))]
pub use crate::decode::stream::Stream;
}

Expand Down

0 comments on commit 8750cb0

Please sign in to comment.