Skip to content

Commit c863c8b

Browse files
rmalmaintokatoka
andauthored
Fix clippy (#3102)
* fix clippy * libafl_frida/ * lol * lol --------- Co-authored-by: Toka <tokazerkje@outlook.com>
1 parent 60d0ccb commit c863c8b

File tree

24 files changed

+47
-60
lines changed

24 files changed

+47
-60
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ similar_names = "allow"
173173
too_many_lines = "allow"
174174
comparison_chain = "allow" # This lint makes **ZERO** sense
175175
unnecessary_debug_formatting = "allow" # :thumbsdown: :thumbsdown: :thumbsdown: :thumbsdown: :thumbsdown: :thumbsdown:
176+
struct_field_names = "allow" # ????
176177

177178
[workspace.lints.rustdoc]
178179
# Deny

libafl/src/events/centralized.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,7 @@ where
405405
..
406406
} => {
407407
log::debug!(
408-
"Received {} from {client_id:?} ({client_config:?}, forward {forward_id:?})",
409-
event_name
408+
"Received {event_name} from {client_id:?} ({client_config:?}, forward {forward_id:?})"
410409
);
411410

412411
log::debug!(

libafl/src/events/llmp/restarting.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ where
561561
// Send this mesasge off and we are leaving.
562562
match send_tcp_msg(&mut stream, &msg) {
563563
Ok(()) => (),
564-
Err(e) => log::error!("Failed to send tcp message {:#?}", e),
564+
Err(e) => log::error!("Failed to send tcp message {e:#?}"),
565565
}
566566
log::debug!("Asking he broker to be disconnected");
567567
Ok(())

libafl/src/executors/forkserver.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,10 +1039,7 @@ where
10391039
)));
10401040
}
10411041

1042-
log::info!(
1043-
"All right - new fork server model version {} is up",
1044-
version
1045-
);
1042+
log::info!("All right - new fork server model version {version} is up");
10461043

10471044
let status = forkserver.read_st().map_err(|err| {
10481045
Error::illegal_state(format!("Reading from forkserver failed: {err:?}"))

libafl/src/executors/hooks/inprocess.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ impl InProcessExecutorHandlerData {
505505

506506
if let Ok(bsod) = bsod {
507507
if let Ok(r) = core::str::from_utf8(&bsod) {
508-
log::error!("{}", r);
508+
log::error!("{r}");
509509
}
510510
}
511511
}

libafl/src/executors/hooks/unix.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ pub mod unix_signal_handler {
247247
let _ = writer.flush();
248248
}
249249
if let Ok(r) = core::str::from_utf8(&bsod) {
250-
log::error!("{}", r);
250+
log::error!("{r}");
251251
}
252252
}
253253

@@ -287,7 +287,7 @@ pub mod unix_signal_handler {
287287
let _ = writer.flush();
288288
}
289289
if let Ok(r) = core::str::from_utf8(&bsod) {
290-
log::error!("{}", r);
290+
log::error!("{r}");
291291
}
292292
}
293293
}

libafl/src/mutators/token_mutations.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ where
450450
let Some(meta) = state.metadata_map().get::<CmpValuesMetadata>() else {
451451
return Ok(MutationResult::Skipped);
452452
};
453-
log::trace!("meta: {:x?}", meta);
453+
log::trace!("meta: {meta:x?}");
454454
meta.list.len()
455455
};
456456

@@ -648,7 +648,7 @@ where
648648
let Some(meta) = state.metadata_map().get::<CmpValuesMetadata>() else {
649649
return Ok(MutationResult::Skipped);
650650
};
651-
log::trace!("meta: {:x?}", meta);
651+
log::trace!("meta: {meta:x?}");
652652

653653
let Some(cmps_len) = NonZero::new(meta.list.len()) else {
654654
return Ok(MutationResult::Skipped);

libafl/src/stages/sync.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ where
107107

108108
let mut new_files = vec![];
109109
for dir in &self.sync_dirs {
110-
log::debug!("Syncing from dir: {:?}", dir);
110+
log::debug!("Syncing from dir: {dir:?}");
111111
let new_dir_files = find_new_files_rec(dir, &last)?;
112112
new_files.extend(new_dir_files);
113113
}
@@ -134,7 +134,7 @@ where
134134
.unwrap()
135135
.left_to_sync
136136
.retain(|p| p != &path);
137-
log::debug!("Syncing and evaluating {:?}", path);
137+
log::debug!("Syncing and evaluating {path:?}");
138138
fuzzer.evaluate_input(state, executor, manager, &input)?;
139139
}
140140

libafl/src/state/mod.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -977,10 +977,7 @@ where
977977
self.reset_initial_files_state();
978978
self.canonicalize_input_dirs(in_dirs)?;
979979
if cores.ids.len() > corpus_size {
980-
log::info!(
981-
"low intial corpus count ({}), no parallelism required.",
982-
corpus_size
983-
);
980+
log::info!("low intial corpus count ({corpus_size}), no parallelism required.");
984981
} else {
985982
let core_index = cores
986983
.ids

libafl_bolts/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,7 @@ mod windows_logging {
11061106
// Get the handle to standard output
11071107
let h_stdout: HANDLE = get_stdout_handle();
11081108

1109-
if h_stdout == INVALID_HANDLE_VALUE {
1109+
if ptr::eq(h_stdout, INVALID_HANDLE_VALUE) {
11101110
eprintln!("Failed to get standard output handle");
11111111
return;
11121112
}

0 commit comments

Comments
 (0)