Skip to content

Commit

Permalink
v2: Remove most usages of extern crate.
Browse files Browse the repository at this point in the history
  • Loading branch information
waywardmonkeys committed Oct 21, 2023
1 parent 98b49e4 commit 12f9711
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
6 changes: 2 additions & 4 deletions benches/bench.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
#![feature(test)]
#![allow(deprecated)]

#[macro_use]
extern crate smallvec;
extern crate test;

use self::test::Bencher;
use smallvec::SmallVec;
use smallvec::{smallvec, SmallVec};
use test::Bencher;

const VEC_SIZE: usize = 16;
const SPILLED_SIZE: usize = 100;
Expand Down
10 changes: 2 additions & 8 deletions fuzz/fuzz_targets/smallvec_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,26 +177,20 @@ fn do_test_all(data: &[u8]) {
do_test::<8>(data);
}

#[cfg(feature = "afl")]
#[macro_use]
extern crate afl;
#[cfg(feature = "afl")]
fn main() {
fuzz!(|data| {
afl::fuzz!(|data| {
// Remove the panic hook so we can actually catch panic
// See https://github.com/rust-fuzz/afl.rs/issues/150
std::panic::set_hook(Box::new(|_| {}));
do_test_all(data);
});
}

#[cfg(feature = "honggfuzz")]
#[macro_use]
extern crate honggfuzz;
#[cfg(feature = "honggfuzz")]
fn main() {
loop {
fuzz!(|data| {
honggfuzz::fuzz!(|data| {
// Remove the panic hook so we can actually catch panic
// See https://github.com/rust-fuzz/afl.rs/issues/150
std::panic::set_hook(Box::new(|_| {}));
Expand Down
5 changes: 1 addition & 4 deletions src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -853,13 +853,10 @@ fn test_write() {
assert_eq!(small_vec.as_ref(), data.as_ref());
}

#[cfg(feature = "serde")]
extern crate bincode;

#[cfg(feature = "serde")]
#[test]
fn test_serde() {
use self::bincode::{config, deserialize};
use bincode::{config, deserialize};
let mut small_vec: SmallVec<i32, 2> = SmallVec::new();
small_vec.push(1);
let encoded = config().limit(100).serialize(&small_vec).unwrap();
Expand Down

0 comments on commit 12f9711

Please sign in to comment.