Fixing clippy some more (#1872)

* Fixing clippy some more

* more commit

* Git gud

* remove more useless imports
This commit is contained in:
Dominik Maier 2024-02-19 16:46:06 +01:00 committed by GitHub
parent 578a22a3d9
commit fafe8f5ce8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
23 changed files with 20 additions and 33 deletions

View File

@ -4,8 +4,6 @@
use alloc::string::String;
use core::{
cell::{Ref, RefMut},
default::Default,
option::Option,
time::Duration,
};
#[cfg(feature = "std")]

View File

@ -6,7 +6,6 @@ use std::fs::create_dir_all;
use grammartec::{chunkstore::ChunkStore, context::Context};
use libafl_bolts::Named;
use serde::{Deserialize, Serialize};
use serde_json;
use crate::{
corpus::{Corpus, Testcase},

View File

@ -4,7 +4,6 @@
use alloc::{borrow::ToOwned, rc::Rc, string::String, vec::Vec};
use core::{
cell::RefCell,
convert::From,
hash::{BuildHasher, Hasher},
};
#[cfg(feature = "std")]

View File

@ -9,7 +9,6 @@ use alloc::{borrow::ToOwned, rc::Rc, string::String, vec::Vec};
use core::str::from_utf8;
use core::{
cell::RefCell,
convert::From,
hash::{BuildHasher, Hasher},
};

View File

@ -2,7 +2,6 @@
use alloc::{rc::Rc, string::String, vec::Vec};
use core::{
cell::RefCell,
convert::From,
hash::{BuildHasher, Hasher},
};

View File

@ -5,7 +5,7 @@
//use core::hash::Hasher;
use alloc::{rc::Rc, string::String, vec::Vec};
use core::{cell::RefCell, convert::From};
use core::cell::RefCell;
use std::hash::{Hash, Hasher};
use grammartec::{

View File

@ -22,7 +22,7 @@ use crossterm::{
use hashbrown::HashMap;
use libafl_bolts::{current_time, format_duration_hms, ClientId};
use ratatui::{backend::CrosstermBackend, Terminal};
use serde_json::{self, Value};
use serde_json::Value;
#[cfg(feature = "introspection")]
use super::{ClientPerfMonitor, PerfFeature};

View File

@ -1401,7 +1401,7 @@ mod tests {
use super::*;
use crate::{
corpus::{Corpus, InMemoryCorpus},
corpus::InMemoryCorpus,
feedbacks::ConstFeedback,
inputs::BytesInput,
mutators::MutatorsTuple,

View File

@ -520,10 +520,15 @@ where
#[cfg(test)]
mod test {
use libafl_bolts::rands::StdRand;
use libafl_bolts::{rands::StdRand, Error};
use super::*;
use crate::{corpus::NopCorpus, stages::extract_metadata, state::StdState};
use crate::{
corpus::NopCorpus,
inputs::{BytesInput, HasBytesVec},
mutators::{Mutator, StringCategoryRandMutator, StringSubcategoryRandMutator},
stages::extract_metadata,
state::StdState,
};
// a not-so-useful test for this
#[test]

View File

@ -4,7 +4,7 @@ A well-known [`Stage`], for example, is the mutational stage, running multiple [
Other stages may enrich [`crate::corpus::Testcase`]s with metadata.
*/
use core::{convert::From, marker::PhantomData};
use core::marker::PhantomData;
pub use calibrate::CalibrationStage;
pub use colorization::*;

View File

@ -365,9 +365,6 @@ pub fn parse_args() -> FuzzerOptions {
any(feature = "cli", feature = "qemu_cli", feature = "frida_cli")
))]
mod tests {
#[cfg(feature = "frida_cli")]
use alloc::string::String;
use super::*;
/// pass a standard option and `--` followed by some options that `FuzzerOptions` doesn't know

View File

@ -211,7 +211,6 @@ pub mod launcher {}
use core::{
array::TryFromSliceError,
fmt::{self, Display},
iter::Iterator,
num::{ParseIntError, TryFromIntError},
time,
};

View File

@ -2,7 +2,7 @@
use core::{debug_assert, fmt::Debug};
#[cfg(feature = "rand_trait")]
use rand_core::{self, impls::fill_bytes_via_next, RngCore};
use rand_core::{impls::fill_bytes_via_next, RngCore};
use serde::{de::DeserializeOwned, Deserialize, Serialize};
#[cfg(feature = "std")]

View File

@ -73,7 +73,6 @@ pub mod serdeany_registry {
hash_map::{Keys, Values, ValuesMut},
HashMap,
};
use postcard;
use serde::{Deserialize, Serialize};
use crate::{

View File

@ -1,7 +1,7 @@
//! Ar Wrapper from `LibAFL`
// pass to e.g. cmake with -DCMAKE_AR=/path/to/fuzzer/target/release/libafl_ar
use std::{convert::Into, env, path::PathBuf, str::FromStr, string::String, vec::Vec};
use std::{env, path::PathBuf, str::FromStr};
use crate::{Error, ToolWrapper, LIB_EXT, LIB_PREFIX};

View File

@ -1,12 +1,9 @@
//! LLVM compiler Wrapper from `LibAFL`
use std::{
convert::Into,
env,
path::{Path, PathBuf},
str::FromStr,
string::String,
vec::Vec,
};
use crate::{CompilerWrapper, Error, ToolWrapper, LIB_EXT, LIB_PREFIX};

View File

@ -57,7 +57,7 @@
)
)]
use std::{convert::Into, path::Path, process::Command, string::String, vec::Vec};
use std::{path::Path, process::Command};
pub mod ar;
pub use ar::ArWrapper;

View File

@ -1,7 +1,7 @@
//! Libtool Wrapper from `LibAFL`
// call make passing LIBTOOL=/path/to/target/release/libafl_libtool
use std::{convert::Into, env, path::PathBuf, str::FromStr, string::String, vec::Vec};
use std::{env, path::PathBuf, str::FromStr};
use crate::{Error, ToolWrapper, LIB_EXT, LIB_PREFIX};

View File

@ -8,10 +8,9 @@ use std::{
io::{BufWriter, Write},
path::PathBuf,
process::{exit, Command},
string::ToString,
};
use clap::{self, Parser};
use clap::Parser;
use libafl::observers::concolic::{
serialization_format::{MessageFileReader, MessageFileWriter, DEFAULT_ENV_NAME},
EXPRESSION_PRUNING, HITMAP_ENV_NAME, NO_FLOAT_ENV_NAME, SELECTIVE_SYMBOLICATION_ENV_NAME,

View File

@ -14,7 +14,7 @@ use libafl::{
inputs::{HasTargetBytes, Input},
Error,
};
use libafl_targets::{self, CMPLOG_MAP_W};
use libafl_targets::CMPLOG_MAP_W;
use rangemap::RangeMap;
use crate::helper::FridaRuntime;

View File

@ -1,6 +1,6 @@
//! Utilities to parse and process ELFs
use std::{convert::AsRef, fs::File, io::Read, ops::Range, path::Path, str};
use std::{fs::File, io::Read, ops::Range, path::Path, str};
use goblin::elf::{header::ET_DYN, Elf};
use libafl::Error;

View File

@ -1,7 +1,6 @@
//! Expose QEMU user `LibAFL` C api to Rust
use core::{
convert::Into,
ffi::c_void,
fmt,
mem::{transmute, MaybeUninit},
@ -1763,8 +1762,6 @@ impl ArchExtras for Emulator {
#[cfg(feature = "python")]
pub mod pybind {
use std::convert::TryFrom;
use pyo3::{exceptions::PyValueError, prelude::*, types::PyInt};
use super::{GuestAddr, GuestUsize, MmapPerms, SyscallHookResult};

View File

@ -7,7 +7,7 @@ use std::{
sync::OnceLock,
};
use clap::{self, Parser};
use clap::Parser;
use libafl::generators::gramatron::{Automaton, Trigger};
use regex::Regex;
use serde_json::Value;