Skip to content

Commit

Permalink
Merge pull request #105 from dtolnay-contrib/body
Browse files Browse the repository at this point in the history
Allow "closure" body to be any expression, not only block
  • Loading branch information
fitzgen committed Mar 27, 2023
2 parents e07c487 + b1cf7d6 commit df3ac96
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/lib.rs
Expand Up @@ -202,7 +202,7 @@ pub fn initialize(_argc: *const isize, _argv: *const *const *const u8) -> isize
/// `"arbitrary-derive"` cargo feature.
#[macro_export]
macro_rules! fuzz_target {
(|$bytes:ident| $body:block) => {
(|$bytes:ident| $body:expr) => {
const _: () = {
/// Auto-generated function
#[no_mangle]
Expand Down Expand Up @@ -244,15 +244,15 @@ macro_rules! fuzz_target {
};
};

(|$data:ident: &[u8]| $body:block) => {
(|$data:ident: &[u8]| $body:expr) => {
$crate::fuzz_target!(|$data| $body);
};

(|$data:ident: $dty: ty| $body:block) => {
$crate::fuzz_target!(|$data: $dty| -> () $body);
(|$data:ident: $dty:ty| $body:expr) => {
$crate::fuzz_target!(|$data: $dty| -> () { $body });
};

(|$data:ident: $dty: ty| -> $rty: ty $body:block) => {
(|$data:ident: $dty:ty| -> $rty:ty $body:block) => {
const _: () = {
/// Auto-generated function
#[no_mangle]
Expand Down

0 comments on commit df3ac96

Please sign in to comment.