Skip to content

Commit ac5af26

Browse files
committed
Remove unnecessary Trait casts
1 parent 9094404 commit ac5af26

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/float/add.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -206,30 +206,30 @@ mod test {
206206
quickcheck! {
207207
fn addsf3(a: U32, b: U32) -> bool {
208208
let (a, b) = (a.0, b.0);
209-
let r = super::__addsf3(<f32 as Float>::from_repr(a), <f32 as Float>::from_repr(b));
210-
r == <f32 as Float>::from_repr(a) + <f32 as Float>::from_repr(b)
209+
let r = super::__addsf3(f32::from_repr(a), f32::from_repr(b));
210+
r == f32::from_repr(a) + f32::from_repr(b)
211211
}
212212

213213
fn adddf3(a: U64, b: U64) -> bool {
214214
let (a, b) = (a.0, b.0);
215-
let r = super::__adddf3(<f64 as Float>::from_repr(a), <f64 as Float>::from_repr(b));
216-
r == <f64 as Float>::from_repr(a) + <f64 as Float>::from_repr(b)
215+
let r = super::__adddf3(f64::from_repr(a), f64::from_repr(b));
216+
r == f64::from_repr(a) + f64::from_repr(b)
217217
}
218218
}
219219

220220
// More tests for special float values
221221

222222
#[test]
223223
fn test_float_tiny_plus_tiny() {
224-
let tiny = <f32 as Float>::from_repr(1);
224+
let tiny = f32::from_repr(1);
225225
let r = super::__addsf3(tiny, tiny);
226226
assert_eq!(r, tiny + tiny);
227227
}
228228

229229
#[test]
230230
fn test_float_small_plus_small() {
231-
let a = <f32 as Float>::from_repr(327);
232-
let b = <f32 as Float>::from_repr(256);
231+
let a = f32::from_repr(327);
232+
let b = f32::from_repr(256);
233233
let r = super::__addsf3(a, b);
234234
assert_eq!(r, a + b);
235235
}

0 commit comments

Comments
 (0)