Skip to content

Commit be38544

Browse files
Remove most usages of extern crate. (#324)
1 parent ca352c7 commit be38544

File tree

3 files changed

+5
-16
lines changed

3 files changed

+5
-16
lines changed

benches/bench.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
#![feature(test)]
22
#![allow(deprecated)]
33

4-
#[macro_use]
5-
extern crate smallvec;
64
extern crate test;
75

8-
use self::test::Bencher;
9-
use smallvec::SmallVec;
6+
use smallvec::{smallvec, SmallVec};
7+
use test::Bencher;
108

119
const VEC_SIZE: usize = 16;
1210
const SPILLED_SIZE: usize = 100;

fuzz/fuzz_targets/smallvec_ops.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,26 +177,20 @@ fn do_test_all(data: &[u8]) {
177177
do_test::<8>(data);
178178
}
179179

180-
#[cfg(feature = "afl")]
181-
#[macro_use]
182-
extern crate afl;
183180
#[cfg(feature = "afl")]
184181
fn main() {
185-
fuzz!(|data| {
182+
afl::fuzz!(|data| {
186183
// Remove the panic hook so we can actually catch panic
187184
// See https://github.com/rust-fuzz/afl.rs/issues/150
188185
std::panic::set_hook(Box::new(|_| {}));
189186
do_test_all(data);
190187
});
191188
}
192189

193-
#[cfg(feature = "honggfuzz")]
194-
#[macro_use]
195-
extern crate honggfuzz;
196190
#[cfg(feature = "honggfuzz")]
197191
fn main() {
198192
loop {
199-
fuzz!(|data| {
193+
honggfuzz::fuzz!(|data| {
200194
// Remove the panic hook so we can actually catch panic
201195
// See https://github.com/rust-fuzz/afl.rs/issues/150
202196
std::panic::set_hook(Box::new(|_| {}));

src/tests.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -853,13 +853,10 @@ fn test_write() {
853853
assert_eq!(small_vec.as_ref(), data.as_ref());
854854
}
855855

856-
#[cfg(feature = "serde")]
857-
extern crate bincode;
858-
859856
#[cfg(feature = "serde")]
860857
#[test]
861858
fn test_serde() {
862-
use self::bincode::{config, deserialize};
859+
use bincode::{config, deserialize};
863860
let mut small_vec: SmallVec<i32, 2> = SmallVec::new();
864861
small_vec.push(1);
865862
let encoded = config().limit(100).serialize(&small_vec).unwrap();

0 commit comments

Comments
 (0)