Skip to content

Commit df3ac96

Browse files
authored
Merge pull request #105 from dtolnay-contrib/body
Allow "closure" body to be any expression, not only block
2 parents e07c487 + b1cf7d6 commit df3ac96

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ pub fn initialize(_argc: *const isize, _argv: *const *const *const u8) -> isize
202202
/// `"arbitrary-derive"` cargo feature.
203203
#[macro_export]
204204
macro_rules! fuzz_target {
205-
(|$bytes:ident| $body:block) => {
205+
(|$bytes:ident| $body:expr) => {
206206
const _: () = {
207207
/// Auto-generated function
208208
#[no_mangle]
@@ -244,15 +244,15 @@ macro_rules! fuzz_target {
244244
};
245245
};
246246

247-
(|$data:ident: &[u8]| $body:block) => {
247+
(|$data:ident: &[u8]| $body:expr) => {
248248
$crate::fuzz_target!(|$data| $body);
249249
};
250250

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

255-
(|$data:ident: $dty: ty| -> $rty: ty $body:block) => {
255+
(|$data:ident: $dty:ty| -> $rty:ty $body:block) => {
256256
const _: () = {
257257
/// Auto-generated function
258258
#[no_mangle]

0 commit comments

Comments
 (0)