Skip to content

Commit 4269f18

Browse files
daxpeddaModProg
authored andcommitted
Fix links in root documentation and README
1 parent d7c48d6 commit 4269f18

File tree

2 files changed

+66
-49
lines changed

2 files changed

+66
-49
lines changed

README.md

Lines changed: 50 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ custom generic type bounds.
1111

1212
## Usage
1313

14-
The `derive_where` attribute can be used just like std's `#[derive(...)]`
15-
statements:
14+
The [`derive_where`] attribute can be used just like
15+
std's `#[derive(...)]` statements:
1616

1717
```rust
1818
#[derive_where(Clone, Debug)]
@@ -23,8 +23,8 @@ This will generate trait implementations for `Example` for any `T`,
2323
as opposed to std's derives, which would only implement these traits with
2424
`T: Trait` bound to the corresponding trait.
2525

26-
Multiple `derive_where` attributes can be added to an item, but only the
27-
first one must use any path qualifications.
26+
Multiple [`derive_where`] attributes can be added to an
27+
item, but only the first one must use any path qualifications.
2828

2929
```rust
3030
#[derive_where::derive_where(Clone, Debug)]
@@ -109,8 +109,8 @@ enum Example<T> {
109109
### Skipping fields
110110

111111
With a `skip` or `skip_inner` attribute fields can be skipped for traits
112-
that allow it, which are: [`Debug`], [`Hash`], [`Ord`](https://doc.rust-lang.org/core/cmp/trait.Ord.html), [`PartialOrd`](https://doc.rust-lang.org/core/cmp/trait.PartialOrd.html),
113-
[`PartialEq`](https://doc.rust-lang.org/core/cmp/trait.PartialEq.html), [`Zeroize`] and [`ZeroizeOnDrop`].
112+
that allow it, which are: [`Debug`], [`Hash`], [`Ord`], [`PartialOrd`],
113+
[`PartialEq`], [`Zeroize`] and [`ZeroizeOnDrop`].
114114

115115
```rust
116116
#[derive_where(Debug, PartialEq; T)]
@@ -164,12 +164,12 @@ assert_ne!(
164164

165165
### `Zeroize` options
166166

167-
[`Zeroize`] has two options:
168-
- `crate`: an item-level option which specifies a path to the `zeroize`
167+
`Zeroize` has two options:
168+
- `crate`: an item-level option which specifies a path to the [`zeroize`]
169169
crate in case of a re-export or rename.
170-
- `fqs`: a field -level option which will use fully-qualified-syntax instead
171-
of calling the [`zeroize`][`method@zeroize`] method on `self` directly.
172-
This is to avoid ambiguity between another method also called `zeroize`.
170+
- `fqs`: a field-level option which will use fully-qualified-syntax instead
171+
of calling the [`zeroize`][method@zeroize] method on `self` directly. This
172+
is to avoid ambiguity between another method also called `zeroize`.
173173

174174
```rust
175175
#[derive_where(Zeroize(crate = "zeroize_"))]
@@ -198,10 +198,10 @@ assert_eq!(test.0, 0);
198198

199199
If the `zeroize-on-drop` feature is enabled, it implements [`ZeroizeOnDrop`]
200200
and can be implemented without [`Zeroize`], otherwise it only implements
201-
[`Drop`](https://doc.rust-lang.org/core/ops/trait.Drop.html) and requires [`Zeroize`] to be implemented.
201+
[`Drop`] and requires [`Zeroize`] to be implemented.
202202

203203
[`ZeroizeOnDrop`] has one option:
204-
- `crate`: an item-level option which specifies a path to the `zeroize`
204+
- `crate`: an item-level option which specifies a path to the [`zeroize`]
205205
crate in case of a re-export or rename.
206206

207207
```rust
@@ -214,19 +214,19 @@ assert!(core::mem::needs_drop::<Example>());
214214
### Supported traits
215215

216216
The following traits can be derived with derive-where:
217-
- [`Clone`](https://doc.rust-lang.org/core/clone/trait.Clone.html)
218-
- [`Copy`](https://doc.rust-lang.org/core/marker/trait.Copy.html)
217+
- [`Clone`]
218+
- [`Copy`]
219219
- [`Debug`]
220220
- [`Default`]
221-
- [`Eq`](https://doc.rust-lang.org/core/cmp/trait.Eq.html)
221+
- [`Eq`]
222222
- [`Hash`]
223-
- [`Ord`](https://doc.rust-lang.org/core/cmp/trait.Ord.html)
224-
- [`PartialEq`](https://doc.rust-lang.org/core/cmp/trait.PartialEq.html)
225-
- [`PartialOrd`](https://doc.rust-lang.org/core/cmp/trait.PartialOrd.html)
223+
- [`Ord`]
224+
- [`PartialEq`]
225+
- [`PartialOrd`]
226226
- [`Zeroize`]: Only available with the `zeroize` crate feature.
227227
- [`ZeroizeOnDrop`]: Only available with the `zeroize` crate feature. If the
228228
`zeroize-on-drop` feature is enabled, it implements [`ZeroizeOnDrop`],
229-
otherwise it only implements [`Drop`](https://doc.rust-lang.org/core/ops/trait.Drop.html).
229+
otherwise it only implements [`Drop`].
230230

231231
### Supported items
232232

@@ -235,27 +235,28 @@ it's best to discourage usage that could be covered by std's `derive`. For
235235
example unit structs and enums only containing unit variants aren't
236236
supported.
237237

238-
Unions only support [`Clone`](https://doc.rust-lang.org/core/clone/trait.Clone.html) and [`Copy`](https://doc.rust-lang.org/core/marker/trait.Copy.html).
238+
Unions only support [`Clone`] and [`Copy`].
239239

240240
### `no_std` support
241241

242242
`no_std` support is provided by default.
243243

244244
## Crate features
245245

246-
- `nightly`: Implements [`Ord`](https://doc.rust-lang.org/core/cmp/trait.Ord.html) and [`PartialOrd`](https://doc.rust-lang.org/core/cmp/trait.PartialOrd.html) with the help of
247-
[`core::intrinsics::discriminant_value`](https://doc.rust-lang.org/core/intrinsics/fn.discriminant_value.html), which is what Rust does by
248-
default too. Without this feature [`transmute`](https://doc.rust-lang.org/core/mem/fn.transmute.html) is
249-
used to convert [`Discriminant`](https://doc.rust-lang.org/core/mem/struct.Discriminant.html) to a [`i32`](https://doc.rust-lang.org/core/primitive.i32.html),
246+
- `nightly`: Implements [`Ord`] and [`PartialOrd`] with the help of
247+
[`core::intrinsics::discriminant_value`], which is what Rust does by
248+
default too. Without this feature [`transmute`] is
249+
used to convert [`Discriminant`] to a [`i32`],
250250
which is the underlying type.
251-
- `safe`: Implements [`Ord`](https://doc.rust-lang.org/core/cmp/trait.Ord.html) and [`PartialOrd`](https://doc.rust-lang.org/core/cmp/trait.PartialOrd.html) manually. This is much
251+
- `safe`: Implements [`Ord`] and [`PartialOrd`] manually. This is much
252252
slower, but might be preferred if you don't trust derive-where. It also
253-
replaces all cases of [`core::hint::unreachable_unchecked`](https://doc.rust-lang.org/core/hint/fn.unreachable_unchecked.html) in [`Ord`](https://doc.rust-lang.org/core/hint/fn.unreachable_unchecked.html),
254-
[`PartialEq`](https://doc.rust-lang.org/core/cmp/trait.PartialEq.html) and [`PartialOrd`](https://doc.rust-lang.org/core/cmp/trait.PartialOrd.html), which is what std uses, with
255-
[`unreachable`](https://doc.rust-lang.org/core/macro.unreachable.html).
256-
- `zeroize`: Allows deriving [`Zeroize`] and [`method@zeroize`] on [`Drop`](https://doc.rust-lang.org/core/ops/trait.Drop.html).
253+
replaces all cases of [`core::hint::unreachable_unchecked`] in [`Ord`],
254+
[`PartialEq`] and [`PartialOrd`], which is what std uses, with
255+
[`unreachable`].
256+
- `zeroize`: Allows deriving [`Zeroize`] and [`zeroize`][method@zeroize] on
257+
[`Drop`].
257258
- `zeroize-on-drop`: Allows deriving [`Zeroize`] and [`ZeroizeOnDrop`] and
258-
requires [zeroize] v1.5.
259+
requires [`zeroize`] v1.5.
259260

260261
## MSRV
261262

@@ -294,10 +295,25 @@ conditions.
294295
[CHANGELOG]: https://github.com/ModProg/derive-where/blob/main/CHANGELOG.md
295296
[LICENSE-MIT]: https://github.com/ModProg/derive-where/blob/main/LICENSE-MIT
296297
[LICENSE-APACHE]: https://github.com/ModProg/derive-where/blob/main/LICENSE-APACHE
297-
[zeroize]: https://crates.io/crates/zeroize/1.5.2
298298
[`Debug`]: https://doc.rust-lang.org/core/fmt/trait.Debug.html
299299
[`Default`]: https://doc.rust-lang.org/core/default/trait.Default.html
300300
[`Hash`]: https://doc.rust-lang.org/core/hash/trait.Hash.html
301+
[`zeroize`]: https://docs.rs/zeroize
301302
[`Zeroize`]: https://docs.rs/zeroize/latest/zeroize/trait.Zeroize.html
302-
[`ZeroizeOnDrop`]: https://docs.rs/zeroize/1.5/zeroize/trait.ZeroizeOnDrop.html
303-
[`method@zeroize`]: https://docs.rs/zeroize/latest/zeroize/trait.Zeroize.html#tymethod.zeroize
303+
[`ZeroizeOnDrop`]: https://docs.rs/zeroize/latest/zeroize/trait.ZeroizeOnDrop.html
304+
[method@zeroize]: https://docs.rs/zeroize/latest/zeroize/trait.Zeroize.html#tymethod.zeroize
305+
306+
[`Clone`]: https://doc.rust-lang.org/core/clone/trait.Clone.html
307+
[`Copy`]: https://doc.rust-lang.org/core/marker/trait.Copy.html
308+
[`core::hint::unreachable_unchecked`]: https://doc.rust-lang.org/core/hint/fn.unreachable_unchecked.html
309+
[`core::intrinsics::discriminant_value`]: https://doc.rust-lang.org/core/intrinsics/fn.discriminant_value.html
310+
[`derive_where`]: https://docs.rs/derive-where/latest/derive_where/attr.derive_where.html
311+
[`Discriminant`]: https://doc.rust-lang.org/core/mem/struct.Discriminant.html
312+
[`Drop`]: https://doc.rust-lang.org/core/ops/trait.Drop.html
313+
[`Eq`]: https://doc.rust-lang.org/core/cmp/trait.Eq.html
314+
[`i32`]: https://doc.rust-lang.org/core/primitive.i32.html
315+
[`Ord`]: https://doc.rust-lang.org/core/cmp/trait.Ord.html
316+
[`PartialEq`]: https://doc.rust-lang.org/core/cmp/trait.PartialEq.html
317+
[`PartialOrd`]: https://doc.rust-lang.org/core/cmp/trait.PartialOrd.html
318+
[`transmute`]: https://doc.rust-lang.org/core/mem/fn.transmute.html
319+
[`unreachable`]: https://doc.rust-lang.org/core/macro.unreachable.html

src/lib.rs

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
//!
1212
//! # Usage
1313
//!
14-
//! The `derive_where` attribute can be used just like std's `#[derive(...)]`
15-
//! statements:
14+
//! The [`derive_where`](macro@derive_where) attribute can be used just like
15+
//! std's `#[derive(...)]` statements:
1616
//!
1717
//! ```
1818
//! # use std::marker::PhantomData;
@@ -25,8 +25,8 @@
2525
//! as opposed to std's derives, which would only implement these traits with
2626
//! `T: Trait` bound to the corresponding trait.
2727
//!
28-
//! Multiple `derive_where` attributes can be added to an item, but only the
29-
//! first one must use any path qualifications.
28+
//! Multiple [`derive_where`](macro@derive_where) attributes can be added to an
29+
//! item, but only the first one must use any path qualifications.
3030
//!
3131
//! ```
3232
//! # use std::marker::PhantomData;
@@ -187,12 +187,12 @@
187187
//!
188188
//! ## `Zeroize` options
189189
//!
190-
//! [`Zeroize`] has two options:
191-
//! - `crate`: an item-level option which specifies a path to the `zeroize`
190+
//! `Zeroize` has two options:
191+
//! - `crate`: an item-level option which specifies a path to the [`zeroize`]
192192
//! crate in case of a re-export or rename.
193-
//! - `fqs`: a field -level option which will use fully-qualified-syntax instead
194-
//! of calling the [`zeroize`][`method@zeroize`] method on `self` directly.
195-
//! This is to avoid ambiguity between another method also called `zeroize`.
193+
//! - `fqs`: a field-level option which will use fully-qualified-syntax instead
194+
//! of calling the [`zeroize`][method@zeroize] method on `self` directly. This
195+
//! is to avoid ambiguity between another method also called `zeroize`.
196196
//!
197197
//! ```
198198
//! # #[cfg(feature = "zeroize")]
@@ -230,7 +230,7 @@
230230
//! [`Drop`] and requires [`Zeroize`] to be implemented.
231231
//!
232232
//! [`ZeroizeOnDrop`] has one option:
233-
//! - `crate`: an item-level option which specifies a path to the `zeroize`
233+
//! - `crate`: an item-level option which specifies a path to the [`zeroize`]
234234
//! crate in case of a re-export or rename.
235235
//!
236236
//! ```
@@ -287,9 +287,10 @@
287287
//! replaces all cases of [`core::hint::unreachable_unchecked`] in [`Ord`],
288288
//! [`PartialEq`] and [`PartialOrd`], which is what std uses, with
289289
//! [`unreachable`].
290-
//! - `zeroize`: Allows deriving [`Zeroize`] and [`method@zeroize`] on [`Drop`].
290+
//! - `zeroize`: Allows deriving [`Zeroize`] and [`zeroize`][method@zeroize] on
291+
//! [`Drop`].
291292
//! - `zeroize-on-drop`: Allows deriving [`Zeroize`] and [`ZeroizeOnDrop`] and
292-
//! requires [zeroize] v1.5.
293+
//! requires [`zeroize`] v1.5.
293294
//!
294295
//! # MSRV
295296
//!
@@ -328,13 +329,13 @@
328329
//! [CHANGELOG]: https://github.com/ModProg/derive-where/blob/main/CHANGELOG.md
329330
//! [LICENSE-MIT]: https://github.com/ModProg/derive-where/blob/main/LICENSE-MIT
330331
//! [LICENSE-APACHE]: https://github.com/ModProg/derive-where/blob/main/LICENSE-APACHE
331-
//! [zeroize]: https://crates.io/crates/zeroize/1.5.2
332332
//! [`Debug`]: core::fmt::Debug
333333
//! [`Default`]: core::default::Default
334334
//! [`Hash`]: core::hash::Hash
335+
//! [`zeroize`]: https://docs.rs/zeroize
335336
//! [`Zeroize`]: https://docs.rs/zeroize/latest/zeroize/trait.Zeroize.html
336-
//! [`ZeroizeOnDrop`]: https://docs.rs/zeroize/1.5/zeroize/trait.ZeroizeOnDrop.html
337-
//! [`method@zeroize`]: https://docs.rs/zeroize/latest/zeroize/trait.Zeroize.html#tymethod.zeroize
337+
//! [`ZeroizeOnDrop`]: https://docs.rs/zeroize/latest/zeroize/trait.ZeroizeOnDrop.html
338+
//! [method@zeroize]: https://docs.rs/zeroize/latest/zeroize/trait.Zeroize.html#tymethod.zeroize
338339
339340
mod attr;
340341
mod data;

0 commit comments

Comments
 (0)