45
45
#![ allow( clippy:: suspicious_op_assign_impl) ]
46
46
#![ allow( clippy:: redundant_field_names) ]
47
47
48
- extern crate num_bigint;
48
+ pub extern crate num_bigint;
49
+ pub extern crate num_traits;
49
50
extern crate num_integer;
50
- extern crate num_traits as traits ;
51
+
51
52
#[ cfg( feature = "serde" ) ]
52
53
extern crate serde;
53
54
@@ -63,8 +64,8 @@ use std::iter::Sum;
63
64
use std:: str:: { self , FromStr } ;
64
65
65
66
use num_bigint:: { BigInt , ParseBigIntError , Sign , ToBigInt } ;
66
- use num_integer:: Integer ;
67
- pub use traits :: { FromPrimitive , Num , One , Signed , ToPrimitive , Zero } ;
67
+ use num_integer:: Integer as IntegerTrait ;
68
+ pub use num_traits :: { FromPrimitive , Num , One , Signed , ToPrimitive , Zero } ;
68
69
69
70
const LOG2_10 : f64 = 3.321928094887362_f64 ;
70
71
@@ -1954,8 +1955,6 @@ mod bigdecimal_serde {
1954
1955
#[ test]
1955
1956
#[ cfg( not( feature = "string-only" ) ) ]
1956
1957
fn test_serde_deserialize_f64 ( ) {
1957
- use traits:: FromPrimitive ;
1958
-
1959
1958
let vals = vec ! [
1960
1959
1.0 ,
1961
1960
0.5 ,
@@ -1981,7 +1980,7 @@ mod bigdecimal_serde {
1981
1980
#[ cfg( test) ]
1982
1981
mod bigdecimal_tests {
1983
1982
use BigDecimal ;
1984
- use traits :: { ToPrimitive , FromPrimitive , Zero } ;
1983
+ use num_traits :: { ToPrimitive , FromPrimitive , Signed , Zero , One } ;
1985
1984
use std:: convert:: TryFrom ;
1986
1985
use std:: str:: FromStr ;
1987
1986
use num_bigint;
@@ -2262,7 +2261,6 @@ mod bigdecimal_tests {
2262
2261
#[ test]
2263
2262
#[ should_panic( expected = "Division by zero" ) ]
2264
2263
fn test_division_by_zero_panics_v2 ( ) {
2265
- use traits:: Zero ;
2266
2264
let x = BigDecimal :: from_str ( "3.14" ) . unwrap ( ) ;
2267
2265
let _r = x / BigDecimal :: zero ( ) ;
2268
2266
}
@@ -2872,7 +2870,6 @@ mod bigdecimal_tests {
2872
2870
2873
2871
#[ test]
2874
2872
fn test_signed ( ) {
2875
- use traits:: { One , Signed , Zero } ;
2876
2873
assert ! ( !BigDecimal :: zero( ) . is_positive( ) ) ;
2877
2874
assert ! ( !BigDecimal :: one( ) . is_negative( ) ) ;
2878
2875
0 commit comments