Skip to content

Commit c2cd6b9

Browse files
committed
update(doc): use #![feature(doc_auto_cfg)] to rm cfg flag for docs.rs
1 parent 2407415 commit c2cd6b9

File tree

4 files changed

+2
-12
lines changed

4 files changed

+2
-12
lines changed

Cargo.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,5 @@ opt-level = 3
5555
[workspace]
5656
members = ["rustdx-cmd"]
5757

58-
# docs.rs-specific configuration
5958
[package.metadata.docs.rs]
60-
# document all features
6159
all-features = true
62-
# defines the configuration attribute `docsrs`
63-
rustdoc-args = ["--cfg", "docsrs"]

src/bytes_helper.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ pub fn date_string(x: u32) -> String {
4848
}
4949

5050
#[cfg(feature = "serde")]
51-
#[cfg_attr(docsrs, doc(cfg(feature = "serde")))]
5251
pub fn ser_date_string<S>(date: &u32, serializer: S) -> Result<S::Ok, S::Error>
5352
where
5453
S: serde::Serializer,
@@ -57,7 +56,6 @@ where
5756
}
5857

5958
#[cfg(feature = "serde")]
60-
#[cfg_attr(docsrs, doc(cfg(feature = "serde")))]
6159
pub fn ser_code_string<S>(code: &u32, serializer: S) -> Result<S::Ok, S::Error>
6260
where
6361
S: serde::Serializer,

src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
#![doc(html_root_url = "https://docs.rs/rustdx/0.2.5")]
2-
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
1+
#![doc(html_root_url = "https://docs.rs/rustdx/0.3.0")]
2+
#![feature(doc_auto_cfg)]
33
// #![feature(test)]
44
// extern crate test;
55

66
pub mod bytes_helper;
77

88
#[cfg(feature = "file")]
9-
#[cfg_attr(docsrs, doc(cfg(feature = "file")))]
109
pub mod file;
1110

1211
#[cfg(feature = "tcp")]
13-
#[cfg_attr(docsrs, doc(cfg(feature = "tcp")))]
1412
pub mod tcp;
1513

1614
use thiserror::Error;

src/tcp/basic.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ impl SecurityList {
116116
}
117117

118118
#[cfg(feature = "encoding_rs")]
119-
#[cfg_attr(docsrs, doc(cfg(feature = "encoding_rs")))]
120119
impl Tdx for SecurityList {
121120
type Item = [SecurityListData];
122121

@@ -178,7 +177,6 @@ impl SecurityListData {
178177
/// ) = struct.unpack("<6sH8s4sBI4s", bytes) # python 表示方式
179178
/// ```
180179
#[cfg(feature = "encoding_rs")]
181-
#[cfg_attr(docsrs, doc(cfg(feature = "encoding_rs")))]
182180
pub fn parse(bytes: &[u8]) -> Self {
183181
let code = unsafe { std::str::from_utf8_unchecked(&bytes[0..6]) }.into();
184182
let (name, encoding_used, had_errors) = encoding_rs::GBK.decode(&bytes[8..16]);

0 commit comments

Comments
 (0)