remove some useless commented code

This commit is contained in:
Andrea Fioraldi 2021-03-05 14:20:37 +01:00
parent 0a4a40101a
commit 2f4f719e64
2 changed files with 1 additions and 52 deletions

View File

@ -41,30 +41,6 @@ where
fn discard_metadata(&mut self, _input: &I) -> Result<(), Error> { fn discard_metadata(&mut self, _input: &I) -> Result<(), Error> {
Ok(()) Ok(())
} }
/*
/// Serialize this feedback's state only, to be restored later using deserialize_state
/// As opposed to completely serializing the observer, this is only needed when the fuzzer is to be restarted
/// If no state is needed to be kept, just return an empty vec.
/// Example:
/// >> The virgin_bits map in AFL needs to be in sync with the corpus
#[inline]
fn serialize_state(&mut self) -> Result<Vec<u8>, Error> {
Ok(vec![])
}
/// Restore the state from a given vec, priviously stored using `serialize_state`
#[inline]
fn deserialize_state(&mut self, serialized_state: &[u8]) -> Result<(), Error> {
let _ = serialized_state;
Ok(())
}
// TODO: Restore_from
fn restore_from(&mut self, restore_from: Self) -> Result<(), Error> {
Ok(())
}
*/
} }
pub trait FeedbacksTuple<I>: serde::Serialize + serde::de::DeserializeOwned pub trait FeedbacksTuple<I>: serde::Serialize + serde::de::DeserializeOwned
@ -84,12 +60,6 @@ where
/// Discards metadata - the end of this input's execution /// Discards metadata - the end of this input's execution
fn discard_metadata_all(&mut self, input: &I) -> Result<(), Error>; fn discard_metadata_all(&mut self, input: &I) -> Result<(), Error>;
/*
/// Restores the state from each of the containing feedbacks in a list of the same shape.
/// Used (prette exclusively) to restore the feedback states after a crash.
fn restore_state_from_all(&mut self, restore_from: &Self) -> Result<(), Error>;
*/
} }
impl<I> FeedbacksTuple<I> for () impl<I> FeedbacksTuple<I> for ()
@ -115,12 +85,6 @@ where
fn discard_metadata_all(&mut self, _input: &I) -> Result<(), Error> { fn discard_metadata_all(&mut self, _input: &I) -> Result<(), Error> {
Ok(()) Ok(())
} }
/*
fn restore_state_from_all(&mut self, restore_from: &Self) -> Result<(), Error> {
Ok(())
}
*/
} }
impl<Head, Tail, I> FeedbacksTuple<I> for (Head, Tail) impl<Head, Tail, I> FeedbacksTuple<I> for (Head, Tail)

View File

@ -57,12 +57,10 @@ pub trait ObserversTuple:
/// Reset all executors in the tuple /// Reset all executors in the tuple
/// This is called right before the next execution. /// This is called right before the next execution.
fn pre_exec_all(&mut self) -> Result<(), Error>; fn pre_exec_all(&mut self) -> Result<(), Error>;
/// Do whatever you need to do after a run. /// Do whatever you need to do after a run.
/// This is called right after the last execution /// This is called right after the last execution
fn post_exec_all(&mut self) -> Result<(), Error>; fn post_exec_all(&mut self) -> Result<(), Error>;
//fn for_each(&self, f: fn(&dyn Observer));
//fn for_each_mut(&mut self, f: fn(&mut dyn Observer));
} }
impl ObserversTuple for () { impl ObserversTuple for () {
@ -72,9 +70,6 @@ impl ObserversTuple for () {
fn post_exec_all(&mut self) -> Result<(), Error> { fn post_exec_all(&mut self) -> Result<(), Error> {
Ok(()) Ok(())
} }
//fn for_each(&self, f: fn(&dyn Observer)) { }
//fn for_each_mut(&mut self, f: fn(&mut dyn Observer)) { }
} }
impl<Head, Tail> ObserversTuple for (Head, Tail) impl<Head, Tail> ObserversTuple for (Head, Tail)
@ -91,16 +86,6 @@ where
self.0.post_exec()?; self.0.post_exec()?;
self.1.post_exec_all() self.1.post_exec_all()
} }
/*fn for_each(&self, f: fn(&dyn Observer)) {
f(&self.0);
self.1.for_each(f)
}
fn for_each_mut(&mut self, f: fn(&mut dyn Observer)) {
f(&mut self.0);
self.1.for_each_mut(f)
}*/
} }
/// A simple observer, just overlooking the runtime of the target. /// A simple observer, just overlooking the runtime of the target.