Skip to content

Commit

Permalink
fix rustdocs
Browse files Browse the repository at this point in the history
  • Loading branch information
kalaninja committed Sep 10, 2023
1 parent 3e1005b commit 3dc49ec
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/data/ne_vec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@
//! assert_eq!(nevec[1], 2);
//! assert_eq!(nevec[2], 3);
//! ```
//!
//! [`ne_vec!`]: crate::ne_vec
use core::num::NonZeroUsize;
use std::ops::{Index, IndexMut};
use std::vec::Vec;
Expand Down Expand Up @@ -680,8 +682,6 @@ fn non_empty_invariant_failed() -> ! {
///
/// Also, note that `ne_vec![expr; 0]` is not allowed, and will panic, because
/// it violates the invariant that a `NEVec` cannot be empty.
///
/// [`NEVec`]: crate::ne_vec::NEVec
#[macro_export]
macro_rules! ne_vec {
($head:expr) => (
Expand Down
2 changes: 1 addition & 1 deletion src/functor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ pub trait Functor<B>: Invariant<B> {
/// ```
fn map(self, f: impl FnMut(Self::Param) -> B) -> Self::Target<B>;

/// Alias for [map] if the implementing type already had a built-in `.map` method.
/// Alias for [Functor::map] if the implementing type already had a built-in `.map` method.
#[inline]
fn fmap<F>(self, f: F) -> Self::Target<B>
where
Expand Down
10 changes: 5 additions & 5 deletions src/higher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ use core::marker::PhantomData;

/// Implementation of Lightweight Higher Kinded Type for a type of kind `* -> *`.
pub trait Higher {
/// Type parameter abstracted by Higher, i.e. `Option<Param>`.
/// Type parameter abstracted by Higher, e.g. `Option<Param>`.
type Param;
/// Swapped higher type, i.e. Target = Option<T>.
/// Swapped higher type, e.g. Target = `Option<T>`.
type Target<T>: Higher<Param = T>;

/// Unsafe cast from one [Higher] type to another. This is a safe operation as long as the
Expand All @@ -43,11 +43,11 @@ pub trait Higher {

/// Implementation of Higher Kinded Type for a type of kind `*, * -> *, *`.
pub trait Higher2 {
/// First type parameter abstracted by Higher2, i.e. `Result<Param1, _>`.
/// First type parameter abstracted by Higher2, e.g. `Result<Param1, _>`.
type Param1;
/// Second type parameter abstracted by Higher2, i.e. `Result<_, Param2>`.
/// Second type parameter abstracted by Higher2, e.g. `Result<_, Param2>`.
type Param2;
/// Swapped higher type for 2 types, i.e Target = Result<T1, T2>.
/// Swapped higher type for 2 types, e.g. Target = `Result<T1, T2>`.
type Target<T1, T2>: Higher2<Param1 = T1, Param2 = T2>;
}

Expand Down
2 changes: 1 addition & 1 deletion src/invariant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ macro_rules! invariant_functor {
};
}

/// Macro to implement [Invariant] for types implementing [Contravariant].
/// Macro to implement [Invariant] for types implementing a contravariant [Functor].
#[macro_export]
macro_rules! invariant_contravariant {
($name:ident<$( $t:tt ),+>) => {
Expand Down

0 comments on commit 3dc49ec

Please sign in to comment.