clippy fixes

This commit is contained in:
Dominik Maier 2021-06-29 12:30:49 +02:00
parent c2cd49413b
commit 716af8920b

View File

@ -53,26 +53,26 @@ pub fn libafl_main() {
.expect("No valid core count given!");
let broker_port = matches
.value_of("broker_port")
.map(|s| s.parse().expect("Invalid broker port".into()))
.map(|s| s.parse().expect("Invalid broker port"))
.unwrap_or(1337);
let remote_broker_addr = matches
.value_of("remote_broker_addr")
.map(|s| s.parse().expect("Invalid broker address".into()));
.map(|s| s.parse().expect("Invalid broker address"));
let input_dirs: Vec<PathBuf> = matches
.values_of("input")
.map(|v| v.map(|s| PathBuf::from(s)).collect())
.unwrap_or(vec![]);
.map(|v| v.map(PathBuf::from).collect())
.unwrap_or_default();
let output_dir = matches
.value_of("output")
.map(|s| PathBuf::from(s))
.unwrap_or(workdir.clone());
.map(PathBuf::from)
.unwrap_or_else(|| workdir.clone());
let token_files: Vec<&str> = matches
.values_of("tokens")
.map(|v| v.collect())
.unwrap_or(vec![]);
.unwrap_or_default();
let timeout_ms = matches
.value_of("timeout")
.map(|s| s.parse().expect("Invalid timeout".into()))
.map(|s| s.parse().expect("Invalid timeout"))
.unwrap_or(10000);
// let cmplog_enabled = matches.is_present("cmplog");
@ -197,7 +197,7 @@ pub fn libafl_main() {
// In case the corpus is empty (on first run), reset
if state.corpus().count() < 1 {
if input_dirs.len() == 0 {
if input_dirs.is_empty() {
// Generator of printable bytearrays of max size 32
let mut generator = RandBytesGenerator::new(32);