Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
Updating semantics and syntax to refect clippy.
Browse files Browse the repository at this point in the history
  • Loading branch information
nharper32 committed Dec 9, 2021
1 parent 8c3ca0f commit e6ac485
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 28 deletions.
7 changes: 0 additions & 7 deletions src/agent/onefuzz-agent/src/local/tui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,6 @@ const TICK_RATE: Duration = Duration::from_millis(250);
const FILE_MONITOR_POLLING_PERIOD: Duration = Duration::from_secs(5);
const EVENT_POLLING_PERIOD: Duration = Duration::from_secs(1);

#[derive(Debug, Default)]
struct CoverageData {
covered: Option<u64>,
features: Option<u64>,
rate: Option<f64>,
}

/// Event driving the refresh of the UI
#[derive(Debug)]
enum TerminalEvent {
Expand Down
7 changes: 0 additions & 7 deletions src/agent/onefuzz-agent/src/tasks/merge/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@ use std::{
use storage_queue::{QueueClient, EMPTY_QUEUE_DELAY};
use tokio::process::Command;

#[derive(Debug, Deserialize)]
struct QueueMessage {
content_length: u32,

url: Url,
}

#[derive(Debug, Deserialize)]
pub struct Config {
pub supervisor_exe: String,
Expand Down
6 changes: 0 additions & 6 deletions src/agent/onefuzz-agent/src/tasks/merge/libfuzzer_merge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ use std::{
};
use storage_queue::{QueueClient, EMPTY_QUEUE_DELAY};

#[derive(Debug, Deserialize)]
struct QueueMessage {
content_length: u32,
url: Url,
}

#[derive(Debug, Deserialize)]
pub struct Config {
pub target_exe: PathBuf,
Expand Down
8 changes: 4 additions & 4 deletions src/agent/onefuzz-agent/src/tasks/report/crash_report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ pub struct NoCrash {
#[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum CrashTestResult {
CrashReport(CrashReport),
NoRepro(NoCrash),
CrashReport(Box<CrashReport>),
NoRepro(Box<NoCrash>),
}

#[derive(Debug, Deserialize, Serialize)]
Expand Down Expand Up @@ -268,13 +268,13 @@ pub async fn parse_report_file(path: PathBuf) -> Result<CrashTestResult> {
let report: Result<CrashReport, serde_json::Error> = serde_json::from_value(json.clone());

let report_err = match report {
Ok(report) => return Ok(CrashTestResult::CrashReport(report)),
Ok(report) => return Ok(CrashTestResult::CrashReport(Box::new(report))),
Err(err) => err,
};
let no_repro: Result<NoCrash, serde_json::Error> = serde_json::from_value(json);

let no_repro_err = match no_repro {
Ok(no_repro) => return Ok(CrashTestResult::NoRepro(no_repro)),
Ok(no_repro) => return Ok(CrashTestResult::NoRepro(Box::new(no_repro))),
Err(err) => err,
};

Expand Down
4 changes: 2 additions & 2 deletions src/agent/onefuzz-agent/src/tasks/report/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ pub async fn test_input(args: TestInputArgs<'_>) -> Result<CrashTestResult> {
input_sha256,
args.minimized_stack_depth,
);
Ok(CrashTestResult::CrashReport(crash_report))
Ok(CrashTestResult::CrashReport(Box::new(crash_report)))
} else {
let no_repro = NoCrash {
input_blob,
Expand All @@ -164,7 +164,7 @@ pub async fn test_input(args: TestInputArgs<'_>) -> Result<CrashTestResult> {
error: test_report.error.map(|e| format!("{}", e)),
};

Ok(CrashTestResult::NoRepro(no_repro))
Ok(CrashTestResult::NoRepro(Box::new(no_repro)))
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/agent/onefuzz-agent/src/tasks/report/libfuzzer_report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ pub async fn test_input(args: TestInputArgs<'_>) -> Result<CrashTestResult> {
input_sha256,
args.minimized_stack_depth,
);
Ok(CrashTestResult::CrashReport(crash_report))
Ok(CrashTestResult::CrashReport(Box::new(crash_report)))
}
None => {
let no_repro = NoCrash {
Expand All @@ -163,7 +163,7 @@ pub async fn test_input(args: TestInputArgs<'_>) -> Result<CrashTestResult> {
error: test_report.error.map(|e| format!("{}", e)),
};

Ok(CrashTestResult::NoRepro(no_repro))
Ok(CrashTestResult::NoRepro(Box::new(no_repro)))
}
}
}
Expand Down

0 comments on commit e6ac485

Please sign in to comment.