Skip to content

Commit

Permalink
Relax Fn requirement, use FnOnce instead
Browse files Browse the repository at this point in the history
  • Loading branch information
g2p committed Jun 9, 2018
1 parent 33bd4e4 commit ed05a2b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ extern "C" {
/// ```
#[cfg(not(fuzzing))]
#[allow(unused_variables)]
pub fn fuzz<F>(closure: F) where F: Fn(&[u8]) {
pub fn fuzz<F>(closure: F) where F: FnOnce(&[u8]) {
eprintln!("This executable hasn't been built with \"cargo hfuzz\".");
eprintln!("Try executing \"cargo hfuzz build\" and check out \"hfuzz_target\" directory.");
eprintln!("Or execute \"cargo hfuzz run TARGET\"");
Expand All @@ -249,7 +249,7 @@ lazy_static! {
}

#[cfg(all(fuzzing, not(fuzzing_debug)))]
pub fn fuzz<F>(closure: F) where F: Fn(&[u8]) + std::panic::RefUnwindSafe {
pub fn fuzz<F>(closure: F) where F: FnOnce(&[u8]) + std::panic::RefUnwindSafe {
// sets panic hook if not already done
lazy_static::initialize(&PANIC_HOOK);

Expand Down Expand Up @@ -278,7 +278,7 @@ pub fn fuzz<F>(closure: F) where F: Fn(&[u8]) + std::panic::RefUnwindSafe {
}

#[cfg(all(fuzzing, fuzzing_debug))]
pub fn fuzz<F>(closure: F) where F: Fn(&[u8]) {
pub fn fuzz<F>(closure: F) where F: FnOnce(&[u8]) {
use std::env;
use std::fs::File;
use memmap::MmapOptions;
Expand Down

0 comments on commit ed05a2b

Please sign in to comment.