Skip to content

Commit c26f154

Browse files
authored
password-hash: use doc_auto_cfg (#1268)
Automatically generate feature-specific documentation
1 parent fa4185d commit c26f154

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

password-hash/src/lib.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![no_std]
2-
#![cfg_attr(docsrs, feature(doc_cfg))]
2+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
33
#![doc = include_str!("../README.md")]
44
#![doc(
55
html_logo_url = "https://raw.githubusercontent.com/RustCrypto/media/8f1a9894/logo.svg",
@@ -26,7 +26,6 @@ extern crate alloc;
2626
extern crate std;
2727

2828
#[cfg(feature = "rand_core")]
29-
#[cfg_attr(docsrs, doc(cfg(feature = "rand_core")))]
3029
pub use rand_core;
3130

3231
pub mod errors;
@@ -231,7 +230,6 @@ impl<'a> PasswordHash<'a> {
231230

232231
/// Serialize this [`PasswordHash`] as a [`PasswordHashString`].
233232
#[cfg(feature = "alloc")]
234-
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
235233
pub fn serialize(&self) -> PasswordHashString {
236234
self.into()
237235
}
@@ -277,7 +275,6 @@ impl<'a> fmt::Display for PasswordHash<'a> {
277275
/// parse successfully.
278276
// TODO(tarcieri): cached parsed representations? or at least structural data
279277
#[cfg(feature = "alloc")]
280-
#[cfg_attr(docsrs, doc(cfg(feature = "alloc")))]
281278
#[derive(Clone, Debug, Eq, PartialEq)]
282279
pub struct PasswordHashString {
283280
/// String value

password-hash/src/salt.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ pub struct SaltString {
203203
impl SaltString {
204204
/// Generate a random B64-encoded [`SaltString`].
205205
#[cfg(feature = "rand_core")]
206-
#[cfg_attr(docsrs, doc(cfg(feature = "rand_core")))]
207206
pub fn generate(mut rng: impl CryptoRngCore) -> Self {
208207
let mut bytes = [0u8; Salt::RECOMMENDED_LENGTH];
209208
rng.fill_bytes(&mut bytes);

0 commit comments

Comments
 (0)