@@ -12,7 +12,6 @@ use super::value::{
1212} ;
1313use bigdecimal:: BigDecimal ;
1414use bytes:: BufMut ;
15- use num_bigint:: BigInt ;
1615use std:: collections:: hash_map:: DefaultHasher ;
1716use std:: collections:: { BTreeMap , BTreeSet , HashMap , HashSet } ;
1817use std:: hash:: { BuildHasherDefault , Hash , Hasher } ;
@@ -110,13 +109,14 @@ fn cql_varint_normalization() {
110109 }
111110}
112111
112+ #[ cfg( feature = "num-bigint-03" ) ]
113113#[ test]
114- fn cql_varint_normalization_with_bigint ( ) {
114+ fn cql_varint_normalization_with_bigint03 ( ) {
115115 let test_cases = cql_varint_normalization_test_cases ( ) ;
116116
117117 for test in test_cases {
118- let non_normalized: BigInt = CqlVarint :: from_signed_bytes_be ( test. 0 ) . into ( ) ;
119- let normalized: BigInt = CqlVarint :: from_signed_bytes_be ( test. 1 ) . into ( ) ;
118+ let non_normalized: num_bigint_03 :: BigInt = CqlVarint :: from_signed_bytes_be ( test. 0 ) . into ( ) ;
119+ let normalized: num_bigint_03 :: BigInt = CqlVarint :: from_signed_bytes_be ( test. 1 ) . into ( ) ;
120120
121121 assert_eq ! ( non_normalized, normalized) ;
122122 }
@@ -147,8 +147,9 @@ fn cql_varint_serialization() {
147147 }
148148}
149149
150+ #[ cfg( feature = "num-bigint-03" ) ]
150151#[ test]
151- fn bigint_serialization ( ) {
152+ fn bigint03_serialization ( ) {
152153 let cases_from_the_spec: & [ ( i64 , Vec < u8 > ) ] = & [
153154 ( 0 , vec ! [ 0x00 ] ) ,
154155 ( 1 , vec ! [ 0x01 ] ) ,
@@ -161,7 +162,7 @@ fn bigint_serialization() {
161162 ] ;
162163
163164 for ( i, b) in cases_from_the_spec {
164- let x = BigInt :: from ( * i) ;
165+ let x = num_bigint_03 :: BigInt :: from ( * i) ;
165166 let b_with_len = ( b. len ( ) as i32 )
166167 . to_be_bytes ( )
167168 . iter ( )
@@ -195,7 +196,7 @@ fn bigdecimal_serialization() {
195196 . chain ( serialized_digits)
196197 . cloned ( )
197198 . collect :: < Vec < _ > > ( ) ;
198- let digits = BigInt :: from ( * digits) ;
199+ let digits = bigdecimal :: num_bigint :: BigInt :: from ( * digits) ;
199200 let x = BigDecimal :: new ( digits, exponent as i64 ) ;
200201 assert_eq ! ( serialized( x, ColumnType :: Decimal ) , repr) ;
201202 }
0 commit comments