Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use expr metavariable in fuzz! macro #490

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

madsmtm
Copy link
Contributor

@madsmtm madsmtm commented Jun 4, 2024

This allows expressions not wrapped in curly brackets, which is useful when e.g. calling out to another function:

fn fuzz_with(data: &[u8]) {
    // Do fuzzing
}

fn main() {
    fuzz!(|data| fuzz_with(data));
}

// before
fn main() {
    fuzz!(|data| { // Curly bracket required.
        fuzz_with(data);
    });
}

This allows expressions not wrapped in curly brackets, which is useful when e.g. calling out to another function:
    fn fuzz_with(data: &[u8]) {
        // Do fuzzing
    }

    fn main() {
        fuzz!(|data| fuzz_with(data));
    }
@smoelius
Copy link
Member

smoelius commented Jun 5, 2024

Thanks!

@smoelius smoelius added this pull request to the merge queue Jun 5, 2024
Merged via the queue into rust-fuzz:master with commit bac9ed4 Jun 5, 2024
12 checks passed
@madsmtm madsmtm deleted the macro-expr branch June 5, 2024 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants