@@ -8,9 +8,9 @@ extern crate alloc;
88#[ cfg( feature = "std" ) ]
99extern crate std as alloc;
1010
11- #[ cfg( feature = " specialize" ) ]
11+ #[ cfg( specialize) ]
1212use alloc:: string:: String ;
13- #[ cfg( feature = " specialize" ) ]
13+ #[ cfg( specialize) ]
1414use alloc:: vec:: Vec ;
1515
1616/// Provides a way to get an optimized hasher for a given data type.
@@ -20,7 +20,7 @@ pub(crate) trait CallHasher {
2020 fn get_hash < H : Hash + ?Sized > ( value : & H , random_state : & RandomState ) -> u64 ;
2121}
2222
23- #[ cfg( not( feature = " specialize" ) ) ]
23+ #[ cfg( not( specialize) ) ]
2424impl < T > CallHasher for T
2525where
2626 T : Hash + ?Sized ,
3333 }
3434}
3535
36- #[ cfg( feature = " specialize" ) ]
36+ #[ cfg( specialize) ]
3737impl < T > CallHasher for T
3838where
3939 T : Hash + ?Sized ,
4848
4949macro_rules! call_hasher_impl_u64 {
5050 ( $typ: ty) => {
51- #[ cfg( feature = " specialize" ) ]
51+ #[ cfg( specialize) ]
5252 impl CallHasher for $typ {
5353 #[ inline]
5454 fn get_hash<H : Hash + ?Sized >( value: & H , random_state: & RandomState ) -> u64 {
@@ -76,7 +76,7 @@ call_hasher_impl_u64!(&i64);
7676
7777macro_rules! call_hasher_impl_fixed_length{
7878 ( $typ: ty) => {
79- #[ cfg( feature = " specialize" ) ]
79+ #[ cfg( specialize) ]
8080 impl CallHasher for $typ {
8181 #[ inline]
8282 fn get_hash<H : Hash + ?Sized >( value: & H , random_state: & RandomState ) -> u64 {
@@ -95,31 +95,31 @@ call_hasher_impl_fixed_length!(&i128);
9595call_hasher_impl_fixed_length ! ( & usize ) ;
9696call_hasher_impl_fixed_length ! ( & isize ) ;
9797
98- #[ cfg( feature = " specialize" ) ]
98+ #[ cfg( specialize) ]
9999impl CallHasher for [ u8 ] {
100100 #[ inline]
101101 fn get_hash < H : Hash + ?Sized > ( value : & H , random_state : & RandomState ) -> u64 {
102102 random_state. hash_as_str ( value)
103103 }
104104}
105105
106- #[ cfg( feature = " specialize" ) ]
106+ #[ cfg( specialize) ]
107107impl CallHasher for Vec < u8 > {
108108 #[ inline]
109109 fn get_hash < H : Hash + ?Sized > ( value : & H , random_state : & RandomState ) -> u64 {
110110 random_state. hash_as_str ( value)
111111 }
112112}
113113
114- #[ cfg( feature = " specialize" ) ]
114+ #[ cfg( specialize) ]
115115impl CallHasher for str {
116116 #[ inline]
117117 fn get_hash < H : Hash + ?Sized > ( value : & H , random_state : & RandomState ) -> u64 {
118118 random_state. hash_as_str ( value)
119119 }
120120}
121121
122- #[ cfg( all( feature = " specialize" ) ) ]
122+ #[ cfg( all( specialize) ) ]
123123impl CallHasher for String {
124124 #[ inline]
125125 fn get_hash < H : Hash + ?Sized > ( value : & H , random_state : & RandomState ) -> u64 {
@@ -133,7 +133,7 @@ mod test {
133133 use crate :: * ;
134134
135135 #[ test]
136- #[ cfg( feature = " specialize" ) ]
136+ #[ cfg( specialize) ]
137137 pub fn test_specialized_invoked ( ) {
138138 let build_hasher = RandomState :: with_seeds ( 1 , 2 , 3 , 4 ) ;
139139 let shortened = u64:: get_hash ( & 0 , & build_hasher) ;
@@ -185,7 +185,7 @@ mod test {
185185 str :: get_hash( & "test" , & build_hasher) ,
186186 String :: get_hash( & "test" . to_string( ) , & build_hasher)
187187 ) ;
188- #[ cfg( feature = " specialize" ) ]
188+ #[ cfg( specialize) ]
189189 assert_eq ! (
190190 str :: get_hash( & "test" , & build_hasher) ,
191191 <[ u8 ] >:: get_hash( "test" . as_bytes( ) , & build_hasher)
@@ -205,7 +205,7 @@ mod test {
205205 str :: get_hash( &&"test" , & build_hasher) ,
206206 String :: get_hash( & "test" . to_string( ) , & build_hasher)
207207 ) ;
208- #[ cfg( feature = " specialize" ) ]
208+ #[ cfg( specialize) ]
209209 assert_eq ! (
210210 str :: get_hash( &&"test" , & build_hasher) ,
211211 <[ u8 ] >:: get_hash( & "test" . to_string( ) . into_bytes( ) , & build_hasher)
0 commit comments