From 857ec6adb60a38ec0b42fb9deebf212a6b4913e7 Mon Sep 17 00:00:00 2001 From: Louis Merlin Date: Fri, 8 Mar 2024 12:53:50 +0700 Subject: [PATCH] Improve example --- README.md | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 7b815cf..c403fbe 100644 --- a/README.md +++ b/README.md @@ -51,21 +51,24 @@ Options: -V, --version Print version ``` -To use it in your own project, simply add `ziggy` as a dependency. +To create a fuzzer, simply add `ziggy` as a dependency. ```toml [dependencies] ziggy = { version = "1.0.0", default-features = false } ``` -Then, use the `fuzz!` macro inside your harness. + +Then use the `fuzz!` macro inside your `main` to create a harness. + ```rust -ziggy::fuzz!(|data: &[u8]| { - if let Ok(string) = std::str::from_utf8(data) { - fuzzme(string); - } -}); +fn main() { + ziggy::fuzz!(|data: &[u8]| { + println!("{data:?}"); + }); +} ``` -For an example fuzz project, see [the url example](./examples/url/). + +For a well-documented fuzzer, see [the url example](./examples/url/). ## The `output` directory