Fix doc tests.

This commit is contained in:
Clar Charr 2018-02-23 17:20:08 -05:00
parent ce3badca57
commit 5d6933f34a
2 changed files with 5 additions and 6 deletions

View File

@ -8,12 +8,11 @@ pub trait Inv {
/// # Examples
///
/// ```
/// use num_traits::{Inv, One};
/// use std::f64::INFINITY;
/// use num_traits::Inv;
///
/// let x = 7.0;
/// let y = -0.0;
/// assert_eq!(x.inv() * x, One::one());
/// assert_eq!(y.inv() * y, One::one());
/// assert_eq!(7.0.inv() * 7.0, 1.0);
/// assert_eq!((-0.0).inv(), -INFINITY);
/// ```
fn inv(self) -> Self::Output;
}

View File

@ -12,7 +12,7 @@ pub trait Pow<RHS> {
///
/// ```
/// use num_traits::Pow;
/// assert_eq!(10.pow(2), 100);
/// assert_eq!(Pow::pow(10u32, 2u32), 100);
/// ```
fn pow(self, rhs: RHS) -> Self::Output;
}