From 708050e5bd637a5cf973fdc11c972cea50abb714 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 3 Apr 2024 12:06:48 +0200 Subject: [PATCH] use doc_auto_cfg feature --- satrs/release-checklist.md | 2 +- satrs/src/action.rs | 9 --------- satrs/src/event_man.rs | 1 - satrs/src/hal/mod.rs | 1 - satrs/src/lib.rs | 5 +---- satrs/src/mode.rs | 2 -- satrs/src/params.rs | 6 ------ satrs/src/pool.rs | 1 - satrs/src/request.rs | 4 ---- 9 files changed, 2 insertions(+), 29 deletions(-) diff --git a/satrs/release-checklist.md b/satrs/release-checklist.md index 349a903..e742ac9 100644 --- a/satrs/release-checklist.md +++ b/satrs/release-checklist.md @@ -4,7 +4,7 @@ Checklist for new releases # Pre-Release 1. Make sure any new modules are documented sufficiently enough and check docs with - `cargo +nightly doc --all-features --config 'rustdocflags=["--cfg", "doc_cfg"]' --open`. + `cargo +nightly doc --all-features --config 'build.rustdocflags=["--cfg", "docs_rs"]' --open`. 2. Bump version specifier in `Cargo.toml`. 3. Update `CHANGELOG.md`: Convert `unreleased` section into version section with date and add new `unreleased` section. diff --git a/satrs/src/action.rs b/satrs/src/action.rs index d2b15d8..4aea9f1 100644 --- a/satrs/src/action.rs +++ b/satrs/src/action.rs @@ -1,7 +1,6 @@ use crate::{params::Params, pool::StoreAddr}; #[cfg(feature = "alloc")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "alloc")))] pub use alloc_mod::*; pub type ActionId = u32; @@ -24,7 +23,6 @@ pub enum ActionRequestVariant { NoData, StoreData(StoreAddr), #[cfg(feature = "alloc")] - #[cfg_attr(doc_cfg, doc(cfg(feature = "alloc")))] VecData(alloc::vec::Vec), } @@ -44,28 +42,21 @@ pub enum ActionReplyVariant { } #[cfg(feature = "alloc")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "alloc")))] pub mod alloc_mod { use super::*; - #[cfg(feature = "alloc")] - #[cfg_attr(doc_cfg, doc(cfg(feature = "alloc")))] #[derive(Debug, Eq, PartialEq, Clone)] pub struct ActionRequestStringId { pub action_id: alloc::string::String, pub variant: ActionRequestVariant, } - #[cfg(feature = "alloc")] - #[cfg_attr(doc_cfg, doc(cfg(feature = "alloc")))] impl ActionRequestStringId { pub fn new(action_id: alloc::string::String, variant: ActionRequestVariant) -> Self { Self { action_id, variant } } } - #[cfg(feature = "alloc")] - #[cfg_attr(doc_cfg, doc(cfg(feature = "alloc")))] #[derive(Debug, PartialEq, Clone)] pub struct ActionReplyStringId { pub action_id: alloc::string::String, diff --git a/satrs/src/event_man.rs b/satrs/src/event_man.rs index 709f21b..38752eb 100644 --- a/satrs/src/event_man.rs +++ b/satrs/src/event_man.rs @@ -130,7 +130,6 @@ pub trait EventReceiveProvider alloc::vec::Vec; fn contains_listener(&self, key: &ListenerKey) -> bool; fn get_listener_ids(&self, key: &ListenerKey) -> Option>; diff --git a/satrs/src/hal/mod.rs b/satrs/src/hal/mod.rs index b6ab984..c374f9b 100644 --- a/satrs/src/hal/mod.rs +++ b/satrs/src/hal/mod.rs @@ -1,4 +1,3 @@ //! # Hardware Abstraction Layer module #[cfg(feature = "std")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "std")))] pub mod std; diff --git a/satrs/src/lib.rs b/satrs/src/lib.rs index 7ba8be2..3c5d29c 100644 --- a/satrs/src/lib.rs +++ b/satrs/src/lib.rs @@ -14,7 +14,7 @@ //! - The [pus] module which provides special support for projects using //! the [ECSS PUS C standard](https://ecss.nl/standard/ecss-e-st-70-41c-space-engineering-telemetry-and-telecommand-packet-utilization-15-april-2016/). #![no_std] -#![cfg_attr(doc_cfg, feature(doc_cfg))] +#![cfg_attr(docs_rs, feature(doc_auto_cfg))] #[cfg(feature = "alloc")] extern crate alloc; #[cfg(feature = "alloc")] @@ -23,17 +23,14 @@ extern crate downcast_rs; extern crate std; #[cfg(feature = "alloc")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "alloc")))] pub mod cfdp; pub mod encoding; pub mod event_man; pub mod events; #[cfg(feature = "std")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "std")))] pub mod executable; pub mod hal; #[cfg(feature = "std")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "std")))] pub mod mode_tree; pub mod pool; pub mod power; diff --git a/satrs/src/mode.rs b/satrs/src/mode.rs index 2f28d07..c3a3e21 100644 --- a/satrs/src/mode.rs +++ b/satrs/src/mode.rs @@ -260,7 +260,6 @@ pub trait ModeReplySender { } #[cfg(feature = "alloc")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "alloc")))] pub mod alloc_mod { use crate::{ mode::ModeRequest, @@ -548,7 +547,6 @@ pub mod alloc_mod { } #[cfg(feature = "std")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "std")))] pub mod std_mod { use std::sync::mpsc; diff --git a/satrs/src/params.rs b/satrs/src/params.rs index 35781c1..10fb41c 100644 --- a/satrs/src/params.rs +++ b/satrs/src/params.rs @@ -590,10 +590,8 @@ pub enum Params { Heapless(ParamsHeapless), Store(StoreAddr), #[cfg(feature = "alloc")] - #[cfg_attr(doc_cfg, doc(cfg(feature = "alloc")))] Vec(Vec), #[cfg(feature = "alloc")] - #[cfg_attr(doc_cfg, doc(cfg(feature = "alloc")))] String(String), } @@ -616,7 +614,6 @@ impl From for Params { } #[cfg(feature = "alloc")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "alloc")))] impl From> for Params { fn from(val: Vec) -> Self { Self::Vec(val) @@ -625,7 +622,6 @@ impl From> for Params { /// Converts a byte slice into the [Params::Vec] variant #[cfg(feature = "alloc")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "alloc")))] impl From<&[u8]> for Params { fn from(val: &[u8]) -> Self { Self::Vec(val.to_vec()) @@ -633,7 +629,6 @@ impl From<&[u8]> for Params { } #[cfg(feature = "alloc")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "alloc")))] impl From for Params { fn from(val: String) -> Self { Self::String(val) @@ -641,7 +636,6 @@ impl From for Params { } #[cfg(feature = "alloc")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "alloc")))] /// Converts a string slice into the [Params::String] variant impl From<&str> for Params { fn from(val: &str) -> Self { diff --git a/satrs/src/pool.rs b/satrs/src/pool.rs index d17f565..1c3b8a4 100644 --- a/satrs/src/pool.rs +++ b/satrs/src/pool.rs @@ -72,7 +72,6 @@ //! } //! ``` #[cfg(feature = "alloc")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "alloc")))] pub use alloc_mod::*; use core::fmt::{Display, Formatter}; use delegate::delegate; diff --git a/satrs/src/request.rs b/satrs/src/request.rs index be520f0..bc43fd7 100644 --- a/satrs/src/request.rs +++ b/satrs/src/request.rs @@ -3,11 +3,9 @@ use core::{fmt, marker::PhantomData}; use serde::{Deserialize, Serialize}; #[cfg(feature = "alloc")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "alloc")))] pub use alloc_mod::*; #[cfg(feature = "std")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "std")))] pub use std_mod::*; use spacepackets::{ @@ -194,7 +192,6 @@ impl> MessageReceiverWithId { } #[cfg(feature = "alloc")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "alloc")))] pub mod alloc_mod { use core::marker::PhantomData; @@ -331,7 +328,6 @@ pub mod alloc_mod { } #[cfg(feature = "std")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "std")))] pub mod std_mod { use super::*;