Clippy nightly fixes (#624)

This commit is contained in:
Dominik Maier 2022-05-07 15:35:37 +02:00 committed by GitHub
parent 196569577f
commit eb70c8025b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 13 additions and 9 deletions

View File

@ -86,7 +86,7 @@ where
phantom_data: PhantomData<(&'a I, &'a OT, &'a S, &'a SP)>, phantom_data: PhantomData<(&'a I, &'a OT, &'a S, &'a SP)>,
} }
impl<'a, CF, I, MT, OT, S, SP> Debug for Launcher<'_, CF, I, MT, OT, S, SP> impl<CF, I, MT, OT, S, SP> Debug for Launcher<'_, CF, I, MT, OT, S, SP>
where where
CF: FnOnce(Option<S>, LlmpRestartingEventManager<I, OT, S, SP>, usize) -> Result<(), Error>, CF: FnOnce(Option<S>, LlmpRestartingEventManager<I, OT, S, SP>, usize) -> Result<(), Error>,
I: Input, I: Input,

View File

@ -560,7 +560,7 @@ macro_rules! create_serde_registry_for_trait {
} }
#[allow(unused_qualifications)] #[allow(unused_qualifications)]
impl<'a> Serialize for dyn $trait_name { impl Serialize for dyn $trait_name {
fn serialize<S>(&self, se: S) -> Result<S::Ok, S::Error> fn serialize<S>(&self, se: S) -> Result<S::Ok, S::Error>
where where
S: Serializer, S: Serializer,

View File

@ -307,7 +307,7 @@ where
#[cfg(feature = "std")] #[cfg(feature = "std")]
#[allow(clippy::type_complexity, clippy::too_many_lines)] #[allow(clippy::type_complexity, clippy::too_many_lines)]
impl<'a, I, MT, SP> SimpleRestartingEventManager<I, MT, SP> impl<I, MT, SP> SimpleRestartingEventManager<I, MT, SP>
where where
I: Input, I: Input,
SP: ShMemProvider, SP: ShMemProvider,

View File

@ -43,6 +43,8 @@ Welcome to `LibAFL`
unused_extern_crates, unused_extern_crates,
unused_import_braces, unused_import_braces,
unused_qualifications, unused_qualifications,
unused_must_use,
missing_docs,
//unused_results //unused_results
))] ))]
#![cfg_attr( #![cfg_attr(
@ -106,6 +108,7 @@ pub use fuzzer::*;
use std::{env::VarError, io}; use std::{env::VarError, io};
#[cfg(feature = "errors_backtrace")] #[cfg(feature = "errors_backtrace")]
/// Error Backtrace type when `errors_backtrace` feature is enabled (== [`backtrace::Backtrace`])
pub type ErrorBacktrace = backtrace::Backtrace; pub type ErrorBacktrace = backtrace::Backtrace;
#[cfg(not(feature = "errors_backtrace"))] #[cfg(not(feature = "errors_backtrace"))]

View File

@ -1,7 +1,7 @@
//! Monitor to display both cumulative and per-client monitor //! Monitor to display both cumulative and per-client monitor
use alloc::{string::String, vec::Vec}; use alloc::{string::String, vec::Vec};
use core::time::Duration; use core::{fmt::Write, time::Duration};
#[cfg(feature = "introspection")] #[cfg(feature = "introspection")]
use alloc::string::ToString; use alloc::string::ToString;
@ -71,7 +71,7 @@ where
pad, client.corpus_size, client.objective_size, client.executions, exec_sec pad, client.corpus_size, client.objective_size, client.executions, exec_sec
); );
for (key, val) in &client.user_monitor { for (key, val) in &client.user_monitor {
fmt += &format!(", {}: {}", key, val); write!(fmt, ", {}: {}", key, val).unwrap();
} }
(self.print_fn)(fmt); (self.print_fn)(fmt);

View File

@ -10,6 +10,7 @@ use tui::{backend::CrosstermBackend, Terminal};
use std::{ use std::{
collections::VecDeque, collections::VecDeque,
fmt::Write,
io::{self, BufRead}, io::{self, BufRead},
string::String, string::String,
sync::{Arc, RwLock}, sync::{Arc, RwLock},
@ -285,7 +286,7 @@ impl Monitor for TuiMonitor {
head, client.corpus_size, client.objective_size, client.executions, exec_sec head, client.corpus_size, client.objective_size, client.executions, exec_sec
); );
for (key, val) in &client.user_monitor { for (key, val) in &client.user_monitor {
fmt += &format!(", {}: {}", key, val); write!(fmt, ", {}: {}", key, val).unwrap();
} }
{ {

View File

@ -280,7 +280,7 @@ impl Add for &Tokens {
} }
} }
impl<'a, 'it> IntoIterator for &'it Tokens { impl<'it> IntoIterator for &'it Tokens {
type Item = <Iter<'it, Vec<u8>> as Iterator>::Item; type Item = <Iter<'it, Vec<u8>> as Iterator>::Item;
type IntoIter = Iter<'it, Vec<u8>>; type IntoIter = Iter<'it, Vec<u8>>;

View File

@ -1351,7 +1351,7 @@ where
} }
} }
impl<'a, 'it, T> AsRefIterator<'it> for OwnedMapObserver<T> impl<'it, T> AsRefIterator<'it> for OwnedMapObserver<T>
where where
T: Default + Copy + 'static + Serialize + serde::de::DeserializeOwned + Debug, T: Default + Copy + 'static + Serialize + serde::de::DeserializeOwned + Debug,
{ {
@ -1363,7 +1363,7 @@ where
} }
} }
impl<'a, 'it, T> AsMutIterator<'it> for OwnedMapObserver<T> impl<'it, T> AsMutIterator<'it> for OwnedMapObserver<T>
where where
T: Default + Copy + 'static + Serialize + serde::de::DeserializeOwned + Debug, T: Default + Copy + 'static + Serialize + serde::de::DeserializeOwned + Debug,
{ {