Skip to content

Commit 5e815ad

Browse files
committed
docs: add doc(cfg(...)) attributes for docsrs feature documentation
1 parent 16c3673 commit 5e815ad

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

src/decoder/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,6 +1174,7 @@ pub enum DecoderError {
11741174
/// The stream contained malformed data and could not be decoded or demuxed.
11751175
#[error("The stream contained malformed data and could not be decoded or demuxed: {0}")]
11761176
#[cfg(feature = "symphonia")]
1177+
#[cfg_attr(docsrs, doc(cfg(feature = "symphonia")))]
11771178
DecodeError(&'static str),
11781179

11791180
/// A default or user-defined limit was reached while decoding or demuxing
@@ -1183,16 +1184,19 @@ pub enum DecoderError {
11831184
"A default or user-defined limit was reached while decoding or demuxing the stream: {0}"
11841185
)]
11851186
#[cfg(feature = "symphonia")]
1187+
#[cfg_attr(docsrs, doc(cfg(feature = "symphonia")))]
11861188
LimitError(&'static str),
11871189

11881190
/// The demuxer or decoder needs to be reset before continuing.
11891191
#[error("The demuxer or decoder needs to be reset before continuing.")]
11901192
#[cfg(feature = "symphonia")]
1193+
#[cfg_attr(docsrs, doc(cfg(feature = "symphonia")))]
11911194
ResetRequired,
11921195

11931196
/// No streams were found by the decoder.
11941197
#[error("No streams were found by the decoder.")]
11951198
#[cfg(feature = "symphonia")]
1199+
#[cfg_attr(docsrs, doc(cfg(feature = "symphonia")))]
11961200
NoStreams,
11971201
}
11981202
assert_error_traits!(DecoderError);

src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@
163163
)]
164164

165165
#[cfg(feature = "playback")]
166+
#[cfg_attr(docsrs, doc(cfg(feature = "playback")))]
166167
pub use cpal::{
167168
self, traits::DeviceTrait, Device, Devices, DevicesError, InputDevices, OutputDevices,
168169
SupportedStreamConfig,
@@ -172,6 +173,7 @@ mod common;
172173
mod sink;
173174
mod spatial_sink;
174175
#[cfg(feature = "playback")]
176+
#[cfg_attr(docsrs, doc(cfg(feature = "playback")))]
175177
pub mod stream;
176178
#[cfg(feature = "wav_output")]
177179
#[cfg_attr(docsrs, doc(cfg(feature = "wav_output")))]
@@ -195,6 +197,7 @@ pub use crate::sink::Sink;
195197
pub use crate::source::Source;
196198
pub use crate::spatial_sink::SpatialSink;
197199
#[cfg(feature = "playback")]
200+
#[cfg_attr(docsrs, doc(cfg(feature = "playback")))]
198201
pub use crate::stream::{play, OutputStream, OutputStreamBuilder, PlayError, StreamError};
199202
#[cfg(feature = "wav_output")]
200203
#[cfg_attr(docsrs, doc(cfg(feature = "wav_output")))]

src/source/agc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ const fn power_of_two(n: usize) -> usize {
4141
const RMS_WINDOW_SIZE: usize = power_of_two(8192);
4242

4343
#[cfg(feature = "experimental")]
44+
#[cfg_attr(docsrs, doc(cfg(feature = "experimental")))]
4445
/// Automatic Gain Control filter for maintaining consistent output levels.
4546
///
4647
/// This struct implements an AGC algorithm that dynamically adjusts audio levels

0 commit comments

Comments
 (0)