From 0c7a41243fc13f45f26377cb34171527d28cd68d Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Wed, 7 Dec 2022 11:13:05 -0700 Subject: [PATCH] Use `doc_auto_cfg` Removes manual `doc_cfg` attributes --- src/keypair.rs | 7 ------- src/lib.rs | 2 +- src/public.rs | 7 ------- 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/keypair.rs b/src/keypair.rs index 24a3529..669d361 100644 --- a/src/keypair.rs +++ b/src/keypair.rs @@ -455,11 +455,9 @@ impl TryFrom<&[u8]> for Keypair { } #[cfg(feature = "pkcs8")] -#[cfg_attr(docsrs, doc(cfg(feature = "pkcs8")))] impl DecodePrivateKey for Keypair {} #[cfg(all(feature = "alloc", feature = "pkcs8"))] -#[cfg_attr(docsrs, doc(cfg(all(feature = "alloc", feaure = "pkcs8"))))] impl pkcs8::EncodePrivateKey for Keypair { fn to_pkcs8_der(&self) -> pkcs8::Result { pkcs8::KeypairBytes::from(self).to_pkcs8_der() @@ -467,7 +465,6 @@ impl pkcs8::EncodePrivateKey for Keypair { } #[cfg(feature = "pkcs8")] -#[cfg_attr(docsrs, doc(cfg(feature = "pkcs8")))] impl TryFrom for Keypair { type Error = pkcs8::Error; @@ -477,7 +474,6 @@ impl TryFrom for Keypair { } #[cfg(feature = "pkcs8")] -#[cfg_attr(docsrs, doc(cfg(feature = "pkcs8")))] impl TryFrom<&pkcs8::KeypairBytes> for Keypair { type Error = pkcs8::Error; @@ -502,7 +498,6 @@ impl TryFrom<&pkcs8::KeypairBytes> for Keypair { } #[cfg(feature = "pkcs8")] -#[cfg_attr(docsrs, doc(cfg(feature = "pkcs8")))] impl From for pkcs8::KeypairBytes { fn from(keypair: Keypair) -> pkcs8::KeypairBytes { pkcs8::KeypairBytes::from(&keypair) @@ -510,7 +505,6 @@ impl From for pkcs8::KeypairBytes { } #[cfg(feature = "pkcs8")] -#[cfg_attr(docsrs, doc(cfg(feature = "pkcs8")))] impl From<&Keypair> for pkcs8::KeypairBytes { fn from(keypair: &Keypair) -> pkcs8::KeypairBytes { pkcs8::KeypairBytes { @@ -521,7 +515,6 @@ impl From<&Keypair> for pkcs8::KeypairBytes { } #[cfg(feature = "pkcs8")] -#[cfg_attr(docsrs, doc(cfg(feature = "pkcs8")))] impl TryFrom> for Keypair { type Error = pkcs8::Error; diff --git a/src/lib.rs b/src/lib.rs index 0887836..943ac8a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -270,7 +270,7 @@ //! ``` #![no_std] -#![cfg_attr(docsrs, feature(doc_cfg))] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] #![warn(future_incompatible)] #![deny(missing_docs)] // refuse to compile if documentation is missing #![cfg_attr(not(test), forbid(unsafe_code))] diff --git a/src/public.rs b/src/public.rs index 66ec6c0..fa9c041 100644 --- a/src/public.rs +++ b/src/public.rs @@ -366,11 +366,9 @@ impl TryFrom<&[u8]> for PublicKey { } #[cfg(feature = "pkcs8")] -#[cfg_attr(docsrs, doc(cfg(feature = "pkcs8")))] impl DecodePublicKey for PublicKey {} #[cfg(all(feature = "alloc", feature = "pkcs8"))] -#[cfg_attr(docsrs, doc(cfg(all(feature = "alloc", feaure = "pkcs8"))))] impl pkcs8::EncodePublicKey for PublicKey { fn to_public_key_der(&self) -> pkcs8::spki::Result { pkcs8::PublicKeyBytes::from(self).to_public_key_der() @@ -378,7 +376,6 @@ impl pkcs8::EncodePublicKey for PublicKey { } #[cfg(feature = "pkcs8")] -#[cfg_attr(docsrs, doc(cfg(feature = "pkcs8")))] impl TryFrom for PublicKey { type Error = pkcs8::spki::Error; @@ -388,7 +385,6 @@ impl TryFrom for PublicKey { } #[cfg(feature = "pkcs8")] -#[cfg_attr(docsrs, doc(cfg(feature = "pkcs8")))] impl TryFrom<&pkcs8::PublicKeyBytes> for PublicKey { type Error = pkcs8::spki::Error; @@ -398,7 +394,6 @@ impl TryFrom<&pkcs8::PublicKeyBytes> for PublicKey { } #[cfg(feature = "pkcs8")] -#[cfg_attr(docsrs, doc(cfg(feature = "pkcs8")))] impl From for pkcs8::PublicKeyBytes { fn from(public_key: PublicKey) -> pkcs8::PublicKeyBytes { pkcs8::PublicKeyBytes::from(&public_key) @@ -406,7 +401,6 @@ impl From for pkcs8::PublicKeyBytes { } #[cfg(feature = "pkcs8")] -#[cfg_attr(docsrs, doc(cfg(feature = "pkcs8")))] impl From<&PublicKey> for pkcs8::PublicKeyBytes { fn from(public_key: &PublicKey) -> pkcs8::PublicKeyBytes { pkcs8::PublicKeyBytes(public_key.to_bytes()) @@ -414,7 +408,6 @@ impl From<&PublicKey> for pkcs8::PublicKeyBytes { } #[cfg(feature = "pkcs8")] -#[cfg_attr(docsrs, doc(cfg(feature = "pkcs8")))] impl TryFrom> for PublicKey { type Error = pkcs8::spki::Error;