File tree 3 files changed +5
-16
lines changed
3 files changed +5
-16
lines changed Original file line number Diff line number Diff line change 1
1
#![ feature( test) ]
2
2
#![ allow( deprecated) ]
3
3
4
- #[ macro_use]
5
- extern crate smallvec;
6
4
extern crate test;
7
5
8
- use self :: test :: Bencher ;
9
- use smallvec :: SmallVec ;
6
+ use smallvec :: { smallvec , SmallVec } ;
7
+ use test :: Bencher ;
10
8
11
9
const VEC_SIZE : usize = 16 ;
12
10
const SPILLED_SIZE : usize = 100 ;
Original file line number Diff line number Diff line change @@ -177,26 +177,20 @@ fn do_test_all(data: &[u8]) {
177
177
do_test :: < 8 > ( data) ;
178
178
}
179
179
180
- #[ cfg( feature = "afl" ) ]
181
- #[ macro_use]
182
- extern crate afl;
183
180
#[ cfg( feature = "afl" ) ]
184
181
fn main ( ) {
185
- fuzz ! ( |data| {
182
+ afl :: fuzz!( |data| {
186
183
// Remove the panic hook so we can actually catch panic
187
184
// See https://github.com/rust-fuzz/afl.rs/issues/150
188
185
std:: panic:: set_hook( Box :: new( |_| { } ) ) ;
189
186
do_test_all( data) ;
190
187
} ) ;
191
188
}
192
189
193
- #[ cfg( feature = "honggfuzz" ) ]
194
- #[ macro_use]
195
- extern crate honggfuzz;
196
190
#[ cfg( feature = "honggfuzz" ) ]
197
191
fn main ( ) {
198
192
loop {
199
- fuzz ! ( |data| {
193
+ honggfuzz :: fuzz!( |data| {
200
194
// Remove the panic hook so we can actually catch panic
201
195
// See https://github.com/rust-fuzz/afl.rs/issues/150
202
196
std:: panic:: set_hook( Box :: new( |_| { } ) ) ;
Original file line number Diff line number Diff line change @@ -853,13 +853,10 @@ fn test_write() {
853
853
assert_eq ! ( small_vec. as_ref( ) , data. as_ref( ) ) ;
854
854
}
855
855
856
- #[ cfg( feature = "serde" ) ]
857
- extern crate bincode;
858
-
859
856
#[ cfg( feature = "serde" ) ]
860
857
#[ test]
861
858
fn test_serde ( ) {
862
- use self :: bincode:: { config, deserialize} ;
859
+ use bincode:: { config, deserialize} ;
863
860
let mut small_vec: SmallVec < i32 , 2 > = SmallVec :: new ( ) ;
864
861
small_vec. push ( 1 ) ;
865
862
let encoded = config ( ) . limit ( 100 ) . serialize ( & small_vec) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments