Skip to content

Commit

Permalink
enable clippy::doc_markdown lint do fixes
Browse files Browse the repository at this point in the history
- fix items in documentation is missing backticks
for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
- also fix some missing intra doc links.
  • Loading branch information
gwen-lg authored and usbalbin committed Jun 16, 2024
1 parent ab7c49d commit 2229fcf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/from.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub trait FromIteratorFixed<T, const N: usize> {
/// assert_eq!(a, [2, 4, 6]);
/// ```
///
/// Using IteratorFixed::collect() to implicitly use FromIteratorFixed:
/// Using `IteratorFixed::collect()` to implicitly use `FromIteratorFixed`:
/// ```
/// use iter_fixed::IntoIteratorFixed;
///
Expand All @@ -48,7 +48,7 @@ impl<T, const N: usize> FromIteratorFixed<T, N> for [T; N] {
/// assert_eq!(a, [2, 4, 6]);
/// ```
///
/// Using IteratorFixed::collect() to implicitly use FromIteratorFixed:
/// Using `IteratorFixed::collect()` to implicitly use `FromIteratorFixed`:
/// ```
/// use iter_fixed::IntoIteratorFixed;
///
Expand Down
4 changes: 2 additions & 2 deletions src/into.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub unsafe trait IntoIteratorFixed<const N: usize> {
/// The type of the elements being iterated over.
type Item;

/// What will be the underlaying iterator for the IteratorFixed that we are turning this into?
/// What will be the underlaying iterator for the [`IteratorFixed`] that we are turning this into?
type IntoIter: Iterator<Item = Self::Item>;

/// Creates a fixed size iterator from a value.
Expand Down Expand Up @@ -43,7 +43,7 @@ where
/// `IteratorFixed` implements `IntoIteratorFixed` as a no op. This allows passing an
/// `IteratorFixed` where an `IntoIteratorFixed` was expected
///
/// Basic usage with zip which expects an IntoIteratorFixed as its argument:
/// Basic usage with zip which expects an `IntoIteratorFixed` as its argument:
/// ```
/// use iter_fixed::IntoIteratorFixed;
/// let one_one = [1, 1].into_iter_fixed();
Expand Down
8 changes: 5 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#![allow(stable_features)]
#![cfg_attr(feature = "nightly_features", allow(incomplete_features))]
#![cfg_attr(feature = "nightly_features", feature(generic_const_exprs))]
// enable additionnal lints
#![warn(clippy::doc_markdown)]

use core::iter;

Expand All @@ -21,7 +23,7 @@ pub use into::IntoIteratorFixed;
/// length. This enables us to turn them back into collections of fixed size without having to
/// perform unnecessary checks during run time.
///
/// Just like Iterator, IteratorFixed provides a lot of methods like:
/// Just like Iterator, `IteratorFixed` provides a lot of methods like:
///
/// * `map`
/// * `inspect`
Expand All @@ -42,9 +44,9 @@ pub struct IteratorFixed<I: Iterator, const N: usize> {

/// Creates a new iterator of fixed size where each iteration calls the provided closure F: FnMut(usize) -> T
///
/// This allows very simple initialization of types that implement `FromIteratorFixed` such as arrays.
/// This allows very simple initialization of types that implement [`FromIteratorFixed`] such as arrays.
///
/// Note: This function is quite similar to [`iter::from_fn`] however note that in contrast to `iter::from_fn`,
/// Note: This function is quite similar to [`iter::from_fn`] however note that in contrast to [`iter::from_fn`],
/// in `IteratorFixed::from_fn` the provided function does not have any say in the number of elements.
/// The length is entirely determined by `N`.
///
Expand Down

0 comments on commit 2229fcf

Please sign in to comment.