Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop importing the float modules in documentation #70782

Merged
merged 3 commits into from
Apr 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/libcore/num/f32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,7 @@ impl f32 {
/// Converts radians to degrees.
///
/// ```
/// use std::f32::consts;
///
/// let angle = consts::PI;
/// let angle = std::f32::consts::PI;
///
/// let abs_difference = (angle.to_degrees() - 180.0).abs();
///
Expand All @@ -413,11 +411,9 @@ impl f32 {
/// Converts degrees to radians.
///
/// ```
/// use std::f32::consts;
///
/// let angle = 180.0f32;
///
/// let abs_difference = (angle.to_radians() - consts::PI).abs();
/// let abs_difference = (angle.to_radians() - std::f32::consts::PI).abs();
///
/// assert!(abs_difference <= f32::EPSILON);
/// ```
Expand Down
8 changes: 2 additions & 6 deletions src/libcore/num/f64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,7 @@ impl f64 {
/// Converts radians to degrees.
///
/// ```
/// use std::f64::consts;
///
/// let angle = consts::PI;
/// let angle = std::f64::consts::PI;
///
/// let abs_difference = (angle.to_degrees() - 180.0).abs();
///
Expand All @@ -427,11 +425,9 @@ impl f64 {
/// Converts degrees to radians.
///
/// ```
/// use std::f64::consts;
///
/// let angle = 180.0_f64;
///
/// let abs_difference = (angle.to_radians() - consts::PI).abs();
/// let abs_difference = (angle.to_radians() - std::f64::consts::PI).abs();
///
/// assert!(abs_difference < 1e-10);
/// ```
Expand Down
12 changes: 0 additions & 12 deletions src/libcore/ops/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ impl<Idx: PartialOrd<Idx>> Range<Idx> {
/// # Examples
///
/// ```
/// use std::f32;
///
/// assert!(!(3..5).contains(&2));
/// assert!( (3..5).contains(&3));
/// assert!( (3..5).contains(&4));
Expand Down Expand Up @@ -198,8 +196,6 @@ impl<Idx: PartialOrd<Idx>> RangeFrom<Idx> {
/// # Examples
///
/// ```
/// use std::f32;
///
/// assert!(!(3..).contains(&2));
/// assert!( (3..).contains(&3));
/// assert!( (3..).contains(&1_000_000_000));
Expand Down Expand Up @@ -282,8 +278,6 @@ impl<Idx: PartialOrd<Idx>> RangeTo<Idx> {
/// # Examples
///
/// ```
/// use std::f32;
///
/// assert!( (..5).contains(&-1_000_000_000));
/// assert!( (..5).contains(&4));
/// assert!(!(..5).contains(&5));
Expand Down Expand Up @@ -453,8 +447,6 @@ impl<Idx: PartialOrd<Idx>> RangeInclusive<Idx> {
/// # Examples
///
/// ```
/// use std::f32;
///
/// assert!(!(3..=5).contains(&2));
/// assert!( (3..=5).contains(&3));
/// assert!( (3..=5).contains(&4));
Expand Down Expand Up @@ -581,8 +573,6 @@ impl<Idx: PartialOrd<Idx>> RangeToInclusive<Idx> {
/// # Examples
///
/// ```
/// use std::f32;
///
/// assert!( (..=5).contains(&-1_000_000_000));
/// assert!( (..=5).contains(&5));
/// assert!(!(..=5).contains(&6));
Expand Down Expand Up @@ -721,8 +711,6 @@ pub trait RangeBounds<T: ?Sized> {
/// # Examples
///
/// ```
/// use std::f32;
///
/// assert!( (3..5).contains(&4));
/// assert!(!(3..5).contains(&2));
///
Expand Down
Loading