Skip to content

Commit 3ee22a7

Browse files
Update arbitrary crate to 0.4
1 parent 371effc commit 3ee22a7

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ travis-ci = { repository = "rust-fuzz/honggfuzz-rs", branch = "master" }
2525
maintenance = { status = "actively-developed" }
2626

2727
[dependencies]
28-
arbitrary = "0.2"
28+
arbitrary = "0.4"
2929

3030
[dev-dependencies]
3131
rand = "0.6"

src/lib.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -370,14 +370,11 @@ macro_rules! fuzz {
370370
(|$buf:ident: $dty:ty| $body:block) => {
371371
honggfuzz::fuzz(|$buf| {
372372
let $buf: $dty = {
373-
use $crate::arbitrary::{Arbitrary, RingBuffer};
373+
use $crate::arbitrary::{Arbitrary, Unstructured};
374374

375-
if let Ok(mut buf) = RingBuffer::new($buf, $buf.len()) {
376-
if let Ok(buf) = Arbitrary::arbitrary(&mut buf) {
377-
buf
378-
} else {
379-
return
380-
}
375+
let mut buf = Unstructured::new($buf);
376+
if let Ok(buf) = Arbitrary::arbitrary(&mut buf) {
377+
buf
381378
} else {
382379
return
383380
}

0 commit comments

Comments
 (0)