Skip to content

Commit

Permalink
Update init doc
Browse files Browse the repository at this point in the history
Co-authored-by: Nick Fitzgerald <[email protected]>
  • Loading branch information
zi0Black and fitzgen authored Jan 23, 2025
1 parent 36f2c11 commit 57296bf
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,21 @@ pub fn initialize(_argc: *const isize, _argv: *const *const *const u8) -> isize
/// #![no_main]
///
/// use libfuzzer_sys::fuzz_target;
///
/// fuzz_target!(init: (), |input| {
/// // ...
/// });
/// use std::collections::HashSet;
/// use std::sync::OnceLock;
///
/// static DICTIONARY: OnceLock<HashSet<String>> = OnceLock::new();
///
/// fuzz_target!(
/// init: {
/// # leat read_dictionary = |_| unimplemented!();
/// let dictionary = read_dictionary("/usr/share/dict/words");
/// DICTIONARY.set(dictionary).unwrap();
/// },
/// |input| {
/// // Use the initialized `DICTIONARY` here...
/// }
/// );
/// ```
///
#[macro_export]
Expand Down

0 comments on commit 57296bf

Please sign in to comment.