From bdb8b0fc1cb946a46b7c5817a8d865c75bb020b9 Mon Sep 17 00:00:00 2001 From: Michael Lamparski Date: Mon, 9 Apr 2018 11:57:53 -0400 Subject: [PATCH] fix docs for Poly move --- core/src/coproduct.rs | 2 +- core/src/hlist.rs | 3 +-- core/src/traits.rs | 18 ++++++++---------- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/core/src/coproduct.rs b/core/src/coproduct.rs index 342e5abcf..b59e5c897 100644 --- a/core/src/coproduct.rs +++ b/core/src/coproduct.rs @@ -483,7 +483,7 @@ impl Coproduct { /// * A single closure (for a Coproduct that is homogenous). /// * A single [`Poly`]. /// - /// [`Poly`]: ../hlist/struct.Poly.html + /// [`Poly`]: ../traits/struct.Poly.html /// /// # Example /// diff --git a/core/src/hlist.rs b/core/src/hlist.rs index 70b439d16..080f8d491 100644 --- a/core/src/hlist.rs +++ b/core/src/hlist.rs @@ -331,7 +331,7 @@ macro_rules! gen_inherent_methods { /// * A single closure (for mapping an HList that is homogenous). /// * A single [`Poly`]. /// - /// [`Poly`]: struct.Poly.html + /// [`Poly`]: ../traits/struct.Poly.html /// /// # Examples /// @@ -474,7 +474,6 @@ macro_rules! gen_inherent_methods { /// f1( x1, f2( x2, f3( x3, ... fN( xN, init))...))) /// ``` /// - /// [`Poly`]: struct.Poly.html /// [`HNil`]: struct.HNil.html /// [`h_cons`]: fn.h_cons.html /// diff --git a/core/src/traits.rs b/core/src/traits.rs index af58b35c7..6e20d53a0 100644 --- a/core/src/traits.rs +++ b/core/src/traits.rs @@ -7,15 +7,11 @@ /// that sometimes occur when trying to implement a trait for &'a T (see this comment: /// https://github.com/lloydmeta/frunk/pull/106#issuecomment-377927198) /// -/// This is essentially From, but the more specific nature of it means it's more ergonomic -/// in actual usage. -/// -/// Implemented for HLists. -/// -/// This functionality is also provided as an [inherent method]. +/// This functionality is also provided as an inherent method [on HLists] and [on Coproducts]. /// However, you may find this trait useful in generic contexts. /// -/// [inherent method]: struct.HCons.html#method.to_ref +/// [on HLists]: ../hlist/struct.HCons.html#method.to_ref +/// [on Coproducts]: ../coproduct/enum.Coproduct.html#method.to_ref pub trait ToRef<'a> { type Output; @@ -29,7 +25,7 @@ pub trait ToRef<'a> { /// This functionality is also provided as an [inherent method]. /// However, you may find this trait useful in generic contexts. /// -/// [inherent method]: struct.HCons.html#method.into_reverse +/// [inherent method]: ../hlist/struct.HCons.html#method.into_reverse pub trait IntoReverse { type Output; @@ -41,11 +37,13 @@ pub trait IntoReverse { /// /// This is a thin generic wrapper type that is used to differentiate /// between single-typed generic closures `F` that implements, say, `Fn(i8) -> bool`, -/// and a Poly-typed `F` that implements multiple Function types, say -/// `Func`, `Func` etc. +/// and a Poly-typed `F` that implements multiple Function types +/// via the [`Func`] trait. (say, `Func` and `Func`) /// /// This is needed because there are completely generic impls for many of the /// HList traits that take a simple unwrapped closure. +/// +/// [`Func`]: trait.Func.html #[derive(Debug, Copy, Clone, Default)] pub struct Poly(pub T);