Skip to content

Commit

Permalink
Merge pull request #196 from caspermeijn/doc_links
Browse files Browse the repository at this point in the history
docs: Use automatic link resolution of rustdoc
  • Loading branch information
fitzgen authored Sep 10, 2024
2 parents 915848a + 5d88713 commit 8b33977
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

//! The `Arbitrary` trait crate.
//!
//! This trait provides an [`Arbitrary`](./trait.Arbitrary.html) trait to
//! This trait provides an [`Arbitrary`] trait to
//! produce well-typed, structured values, from raw, byte buffers. It is
//! generally intended to be used with fuzzers like AFL or libFuzzer. See the
//! [`Arbitrary`](./trait.Arbitrary.html) trait's documentation for details on
//! [`Arbitrary`] trait's documentation for details on
//! automatically deriving, implementing, and/or using the trait.

#![deny(bad_style)]
Expand Down Expand Up @@ -105,7 +105,7 @@ pub use unstructured::Unstructured;
/// arbitrary implementations for each of your `struct` or `enum`'s members. But
/// sometimes you need some amount of raw data, or you need to generate a
/// variably-sized collection type, or something of that sort. The
/// [`Unstructured`][crate::Unstructured] type helps you with these tasks.
/// [`Unstructured`] type helps you with these tasks.
///
/// ```
/// # #[cfg(feature = "derive")] mod foo {
Expand Down Expand Up @@ -190,7 +190,7 @@ pub trait Arbitrary<'a>: Sized {
/// # }
/// ```
///
/// See also the documentation for [`Unstructured`][crate::Unstructured].
/// See also the documentation for [`Unstructured`].
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>;

/// Generate an arbitrary value of `Self` from the entirety of the given
Expand All @@ -199,7 +199,7 @@ pub trait Arbitrary<'a>: Sized {
/// This is similar to Arbitrary::arbitrary, however it assumes that it is
/// the last consumer of the given data, and is thus able to consume it all
/// if it needs. See also the documentation for
/// [`Unstructured`][crate::Unstructured].
/// [`Unstructured`].
fn arbitrary_take_rest(mut u: Unstructured<'a>) -> Result<Self> {
Self::arbitrary(&mut u)
}
Expand All @@ -211,7 +211,7 @@ pub trait Arbitrary<'a>: Sized {
/// creating an arbitrary collection.
///
/// The return value is similar to
/// [`Iterator::size_hint`][iterator-size-hint]: it returns a tuple where
/// [`Iterator::size_hint`]: it returns a tuple where
/// the first element is a lower bound on the number of bytes required, and
/// the second element is an optional upper bound.
///
Expand All @@ -221,7 +221,7 @@ pub trait Arbitrary<'a>: Sized {
/// implementation by hand, and your type can be part of a dynamically sized
/// collection (such as `Vec`), you are strongly encouraged to override this
/// default with a better implementation. The
/// [`size_hint`][crate::size_hint] module will help with this task.
/// [`size_hint`] module will help with this task.
///
/// ## Invariant
///
Expand Down Expand Up @@ -285,8 +285,6 @@ pub trait Arbitrary<'a>: Sized {
/// }
/// }
/// ```
///
/// [iterator-size-hint]: https://doc.rust-lang.org/stable/std/iter/trait.Iterator.html#method.size_hint
#[inline]
fn size_hint(depth: usize) -> (usize, Option<usize>) {
let _ = depth;
Expand Down

0 comments on commit 8b33977

Please sign in to comment.