Skip to content

Commit

Permalink
Fallout from deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
aturon committed Nov 19, 2014
1 parent bdbc09a commit e7fab22
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/libcore/num/f32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,12 +429,12 @@ impl Float for f32 {

/// Converts to degrees, assuming the number is in radians.
#[inline]
fn to_degrees(self) -> f32 { self * (180.0f32 / Float::pi()) }
fn to_degrees(self) -> f32 { self * (180.0f32 / consts::PI) }

/// Converts to radians, assuming the number is in degrees.
#[inline]
fn to_radians(self) -> f32 {
let value: f32 = Float::pi();
let value: f32 = consts::PI;
self * (value / 180.0f32)
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/num/f64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,12 +437,12 @@ impl Float for f64 {

/// Converts to degrees, assuming the number is in radians.
#[inline]
fn to_degrees(self) -> f64 { self * (180.0f64 / Float::pi()) }
fn to_degrees(self) -> f64 { self * (180.0f64 / consts::PI) }

/// Converts to radians, assuming the number is in degrees.
#[inline]
fn to_radians(self) -> f64 {
let value: f64 = Float::pi();
let value: f64 = consts::PI;
self * (value / 180.0)
}
}
Expand Down
8 changes: 5 additions & 3 deletions src/libcore/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ use cmp::{PartialEq, PartialOrd, Eq, Ord, Ordering, Less, Equal, Greater, Equiv}
use cmp;
use default::Default;
use iter::*;
use num::{Int, div_rem};
use num::Int;
use ops;
use option::{None, Option, Some};
use ptr;
Expand Down Expand Up @@ -1384,7 +1384,8 @@ impl<'a, T> Iterator<&'a [T]> for Chunks<'a, T> {
if self.v.len() == 0 {
(0, Some(0))
} else {
let (n, rem) = div_rem(self.v.len(), self.size);
let n = self.v.len() / self.size;
let rem = self.v.len() % self.size;
let n = if rem > 0 { n+1 } else { n };
(n, Some(n))
}
Expand Down Expand Up @@ -1457,7 +1458,8 @@ impl<'a, T> Iterator<&'a mut [T]> for MutChunks<'a, T> {
if self.v.len() == 0 {
(0, Some(0))
} else {
let (n, rem) = div_rem(self.v.len(), self.chunk_size);
let n = self.v.len() / self.chunk_size;
let rem = self.v.len() % self.chunk_size;
let n = if rem > 0 { n + 1 } else { n };
(n, Some(n))
}
Expand Down

4 comments on commit e7fab22

@alexcrichton
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+

@thestinger
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[aturon: removed r-]

How does it make sense to mark an API as stable when it just changed, and you know there isn't consensus for the changes?

@aturon
Copy link
Owner Author

@aturon aturon commented on e7fab22 Nov 19, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thestinger None of the APIs that just changed were marked #[stable]. If you read the PR, you'll note attributes like

#[unstable = "recently settled as part of numerics reform"]

are applied to the portions that were recently changed.

Moreover, the API being stabilized here was just settled via an RFC that addressed a long-standing issue.

@alexcrichton
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+ (from @aturon's comments these apis are not actually #[stable])

Please sign in to comment.