Skip to content

Commit 176e736

Browse files
Add --generate-link-to-definition option when building on docs.rs (#1327)
* Add `--generate-link-to-definition` option when building on docs.rs * Fix documentation issues
1 parent ee80b41 commit 176e736

7 files changed

Lines changed: 15 additions & 5 deletions

File tree

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ include = ["src/", "LICENSE-*", "README.md", "CHANGELOG.md", "COPYRIGHT"]
1919

2020
[package.metadata.docs.rs]
2121
# To build locally:
22-
# RUSTDOCFLAGS="--cfg doc_cfg" cargo +nightly doc --all-features --no-deps --open
22+
# RUSTDOCFLAGS="--cfg doc_cfg" cargo +nightly doc --all-features --no-deps --generate-link-to-definition --open
2323
all-features = true
24-
rustdoc-args = ["--cfg", "doc_cfg"]
24+
rustdoc-args = ["--cfg", "doc_cfg", "--generate-link-to-definition"]
2525

2626
[package.metadata.playground]
2727
features = ["small_rng", "serde1"]

rand_chacha/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ categories = ["algorithms", "no-std"]
1515
edition = "2021"
1616
rust-version = "1.56"
1717

18+
[package.metadata.docs.rs]
19+
rustdoc-args = ["--generate-link-to-definition"]
20+
1821
[dependencies]
1922
rand_core = { path = "../rand_core", version = "0.7.0" }
2023
ppv-lite86 = { version = "0.2.14", default-features = false, features = ["simd"] }

rand_core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ rust-version = "1.56"
1919
# To build locally:
2020
# RUSTDOCFLAGS="--cfg doc_cfg" cargo +nightly doc --all-features --no-deps --open
2121
all-features = true
22-
rustdoc-args = ["--cfg", "doc_cfg"]
22+
rustdoc-args = ["--cfg", "doc_cfg", "--generate-link-to-definition"]
2323

2424
[package.metadata.playground]
2525
all-features = true

rand_distr/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ edition = "2021"
1616
rust-version = "1.56"
1717
include = ["src/", "LICENSE-*", "README.md", "CHANGELOG.md", "COPYRIGHT"]
1818

19+
[package.metadata.docs.rs]
20+
rustdoc-args = ["--generate-link-to-definition"]
21+
1922
[features]
2023
default = ["std"]
2124
std = ["alloc", "rand/std"]

rand_distr/src/geometric.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ impl Distribution<u64> for Geometric
143143
///
144144
/// See [`Geometric`](crate::Geometric) for the general geometric distribution.
145145
///
146-
/// Implemented via iterated [Rng::gen::<u64>().leading_zeros()].
146+
/// Implemented via iterated
147+
/// [`Rng::gen::<u64>().leading_zeros()`](Rng::gen::<u64>().leading_zeros()).
147148
///
148149
/// # Example
149150
/// ```

rand_pcg/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ categories = ["algorithms", "no-std"]
1515
edition = "2021"
1616
rust-version = "1.56"
1717

18+
[package.metadata.docs.rs]
19+
rustdoc-args = ["--generate-link-to-definition"]
20+
1821
[features]
1922
serde1 = ["serde"]
2023

src/distributions/uniform.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
//! `low < high`). The example below merely wraps another back-end.
5353
//!
5454
//! The `new`, `new_inclusive` and `sample_single` functions use arguments of
55-
//! type SampleBorrow<X> to support passing in values by reference or
55+
//! type `SampleBorrow<X>` to support passing in values by reference or
5656
//! by value. In the implementation of these functions, you can choose to
5757
//! simply use the reference returned by [`SampleBorrow::borrow`], or you can choose
5858
//! to copy or clone the value, whatever is appropriate for your type.

0 commit comments

Comments
 (0)