Skip to content

Commit c460642

Browse files
committed
Use docsrs doc(cfg(...)) feature
1 parent 7a12c20 commit c460642

File tree

6 files changed

+9
-4
lines changed

6 files changed

+9
-4
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ exclude = [
2222
[package.metadata.docs.rs]
2323
features = ["stm32f303xc", "rt", "stm32-usbd", "can"]
2424
targets = ["thumbv7em-none-eabihf"]
25+
rustc-args = ["--cfg", "docsrs"]
2526

2627
[dependencies]
2728
cfg-if = "1"

src/adc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Analog to Digital Converter. (Requires feature `stm32f303x[bcde]`)
1+
//! Analog to Digital Converter.
22
//!
33
//! # Examples
44
//!

src/can.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Controller Area Network (Requires feature `can`)
1+
//! Controller Area Network.
22
//!
33
//! CAN is currently not enabled by default, and
44
//! can be enabled by the `can` feature.

src/dma.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Direct memory access (DMA) controller. (Requires feature `stm32f303*` or `stm32f302*`)
1+
//! Direct memory access (DMA) controller.
22
//!
33
//! Currently DMA is only supported for STM32F303 or STM32F302 MCUs.
44
//!

src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,14 @@ pub use stm32f3::stm32f3x4 as pac;
125125
pub use crate::pac::interrupt;
126126

127127
#[cfg(feature = "stm32f303")]
128+
#[cfg_attr(docsrs, doc(cfg(feature = "stm32f303")))]
128129
pub mod adc;
129130
#[cfg(feature = "can")]
131+
#[cfg_attr(docsrs, doc(cfg(feature = "can")))]
130132
pub mod can;
131133
pub mod delay;
132134
#[cfg(any(feature = "stm32f302", feature = "stm32f303"))]
135+
#[cfg_attr(docsrs, doc(cfg(any(feature = "stm32f302", feature = "stm32f303"))))]
133136
pub mod dma;
134137
pub mod flash;
135138
pub mod gpio;
@@ -151,6 +154,7 @@ pub mod timer;
151154
feature = "stm32f303xe",
152155
),
153156
))]
157+
#[cfg_attr(docsrs, doc(cfg(feature = "stm32-usbd")))]
154158
pub mod usb;
155159
pub mod watchdog;
156160

src/usb.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! USB peripheral. (Requires feature `stm32-usbd`)
1+
//! USB peripheral.
22
//!
33
//! See [examples/usb_serial.rs] for a usage example.
44
//!

0 commit comments

Comments
 (0)