Skip to content

Commit 7ce968f

Browse files
committed
Update num-traits, unreachable, remove stainless
1 parent b27bbd4 commit 7ce968f

File tree

3 files changed

+304
-207
lines changed

3 files changed

+304
-207
lines changed

Cargo.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[package]
2-
32
name = "ordered-float"
43
version = "0.5.0"
54
authors = ["Jonathan Reem <jonathan.reem@gmail.com>"]
@@ -8,10 +7,9 @@ description = "Wrappers for total ordering on floats."
87
repository = "https://github.com/reem/rust-ordered-float"
98

109
[dependencies]
11-
num-traits = { version = "0.1", default_features = false }
10+
num-traits = "0.2"
1211
serde = { version = "1.0", optional = true }
13-
unreachable = "0.1"
12+
unreachable = "1"
1413

1514
[dev-dependencies]
16-
stainless = "0.1"
1715
serde_test = "1.0"

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl<T: Float> AsMut<T> for OrderedFloat<T> {
5555
}
5656
}
5757

58-
impl<T: Float + PartialOrd> Ord for OrderedFloat<T> {
58+
impl<T: Float> Ord for OrderedFloat<T> {
5959
fn cmp(&self, other: &OrderedFloat<T>) -> Ordering {
6060
match self.partial_cmp(&other) {
6161
Some(ordering) => ordering,
@@ -77,7 +77,7 @@ impl<T: Float + PartialOrd> Ord for OrderedFloat<T> {
7777
impl<T: Float + PartialEq> PartialEq for OrderedFloat<T> {
7878
fn eq(&self, other: &OrderedFloat<T>) -> bool {
7979
if self.as_ref().is_nan() {
80-
if other.as_ref().is_nan() { true } else { false }
80+
other.as_ref().is_nan()
8181
} else if other.as_ref().is_nan() {
8282
false
8383
} else {
@@ -176,7 +176,7 @@ impl<T: Float> AsRef<T> for NotNaN<T> {
176176
}
177177
}
178178

179-
impl<T: Float + PartialOrd> Ord for NotNaN<T> {
179+
impl<T: Float> Ord for NotNaN<T> {
180180
fn cmp(&self, other: &NotNaN<T>) -> Ordering {
181181
match self.partial_cmp(&other) {
182182
Some(ord) => ord,
@@ -522,7 +522,7 @@ pub struct FloatIsNaN;
522522

523523
impl Error for FloatIsNaN {
524524
fn description(&self) -> &str {
525-
return "NotNaN constructed with NaN";
525+
"NotNaN constructed with NaN"
526526
}
527527
}
528528

0 commit comments

Comments
 (0)