Skip to content

Commit f3c46bc

Browse files
committed
Remove redundant feature
1 parent fdc992d commit f3c46bc

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ zeroize = { version = "1", default-features = false, optional = true, features =
4343
[dev-dependencies]
4444
bincode = "1"
4545
criterion = "0.3.0"
46+
rand_core = { version = "0.6", default-features = false, features = ["getrandom"] }
4647

4748
[[bench]]
4849
name = "x25519"
@@ -55,5 +56,3 @@ serde = ["dep:serde", "curve25519-dalek/serde"]
5556
alloc = ["curve25519-dalek/alloc", "serde?/alloc", "zeroize?/alloc"]
5657
precomputed-tables = ["curve25519-dalek/precomputed-tables"]
5758
reusable_secrets = []
58-
# docs: docsrs and doctest features
59-
docsrs = ["rand_core/getrandom"]

src/lib.rs

+5-10
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@
5353
//! First, Alice uses `EphemeralSecret::new()` and then
5454
//! `PublicKey::from()` to produce her secret and public keys:
5555
//!
56-
#![cfg_attr(feature = "docsrs", doc = "```")]
57-
#![cfg_attr(not(feature = "docsrs"), doc = "```ignore")]
56+
//! ```rust
5857
//! use rand_core::OsRng;
5958
//! use x25519_dalek::{EphemeralSecret, PublicKey};
6059
//!
@@ -64,8 +63,7 @@
6463
//!
6564
//! Bob does the same:
6665
//!
67-
#![cfg_attr(feature = "docsrs", doc = "```")]
68-
#![cfg_attr(not(feature = "docsrs"), doc = "```ignore")]
66+
//! ```rust
6967
//! # use rand_core::OsRng;
7068
//! # use x25519_dalek::{EphemeralSecret, PublicKey};
7169
//! let bob_secret = EphemeralSecret::new(OsRng);
@@ -76,8 +74,7 @@
7674
//! loudly meows `bob_public` back to Alice. Alice now computes her
7775
//! shared secret with Bob by doing:
7876
//!
79-
#![cfg_attr(feature = "docsrs", doc = "```")]
80-
#![cfg_attr(not(feature = "docsrs"), doc = "```ignore")]
77+
//! ```rust
8178
//! # use rand_core::OsRng;
8279
//! # use x25519_dalek::{EphemeralSecret, PublicKey};
8380
//! # let alice_secret = EphemeralSecret::new(OsRng);
@@ -89,8 +86,7 @@
8986
//!
9087
//! Similarly, Bob computes a shared secret by doing:
9188
//!
92-
#![cfg_attr(feature = "docsrs", doc = "```")]
93-
#![cfg_attr(not(feature = "docsrs"), doc = "```ignore")]
89+
//! ```rust
9490
//! # use rand_core::OsRng;
9591
//! # use x25519_dalek::{EphemeralSecret, PublicKey};
9692
//! # let alice_secret = EphemeralSecret::new(OsRng);
@@ -102,8 +98,7 @@
10298
//!
10399
//! These secrets are the same:
104100
//!
105-
#![cfg_attr(feature = "docsrs", doc = "```")]
106-
#![cfg_attr(not(feature = "docsrs"), doc = "```ignore")]
101+
//! ```rust
107102
//! # use rand_core::OsRng;
108103
//! # use x25519_dalek::{EphemeralSecret, PublicKey};
109104
//! # let alice_secret = EphemeralSecret::new(OsRng);

src/x25519.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,7 @@ impl SharedSecret {
267267
/// cannot use the better, safer, and faster ephemeral DH API.
268268
///
269269
/// # Example
270-
#[cfg_attr(feature = "docsrs", doc = "```")]
271-
#[cfg_attr(not(feature = "docsrs"), doc = "```ignore")]
270+
/// ```rust
272271
/// use rand_core::OsRng;
273272
/// use rand_core::RngCore;
274273
///

0 commit comments

Comments
 (0)