From 974062b12da71f899f1ca370ae60db212a3eebc9 Mon Sep 17 00:00:00 2001 From: Dominik Maier Date: Mon, 13 Jan 2025 14:25:52 +0000 Subject: [PATCH] clip --- libafl/examples/tui_mock/main.rs | 9 +++++---- libafl/src/stages/afl_stats.rs | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/libafl/examples/tui_mock/main.rs b/libafl/examples/tui_mock/main.rs index eb3f31e0fd..6ca34fc9cd 100644 --- a/libafl/examples/tui_mock/main.rs +++ b/libafl/examples/tui_mock/main.rs @@ -9,10 +9,11 @@ use libafl_bolts::ClientId; pub fn main() { let mut monitor = TuiMonitor::builder().build(); - let mut client_stats = ClientStats::default(); - - client_stats.corpus_size = 1024; - client_stats.executions = 512; + let client_stats = ClientStats { + corpus_size: 1024, + executions: 512, + ..ClientStats::default() + }; monitor.display("Test", ClientId(0)); sleep(Duration::from_secs(10)); diff --git a/libafl/src/stages/afl_stats.rs b/libafl/src/stages/afl_stats.rs index ee444d8404..c45e0cff35 100644 --- a/libafl/src/stages/afl_stats.rs +++ b/libafl/src/stages/afl_stats.rs @@ -588,7 +588,7 @@ impl Display for AFLPlotData<'_> { } } impl AFLPlotData<'_> { - fn get_header() -> &'static str { + fn header() -> &'static str { "# relative_time, cycles_done, cur_item, corpus_count, pending_total, pending_favs, total_edges, saved_crashes, saved_hangs, max_depth, execs_per_sec, execs_done, edges_found" } } @@ -767,10 +767,10 @@ where // check if it contains any data let file = File::open(path)?; if BufReader::new(file).lines().next().is_none() { - std::fs::write(path, AFLPlotData::get_header())?; + std::fs::write(path, AFLPlotData::header())?; } } else { - std::fs::write(path, AFLPlotData::get_header())?; + std::fs::write(path, AFLPlotData::header())?; } Ok(()) }