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

address issues from latest clippy #1018

Merged
merged 1 commit into from
Jun 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/agent/coverage/src/block/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,8 @@ impl LoadEvents {
let loaded: Vec<_> = new
.iter()
.filter(|(nva, n)| {
old.iter()
.find(|(iva, i)| nva == iva && n.path() == i.path())
.is_none()
!old.iter()
.any(|(iva, i)| *nva == iva && n.path() == i.path())
})
.map(|(va, i)| (*va, i.clone()))
.collect();
Expand All @@ -361,9 +360,8 @@ impl LoadEvents {
let unloaded: Vec<_> = old
.iter()
.filter(|(iva, i)| {
new.iter()
.find(|(nva, n)| nva == iva && n.path() == i.path())
.is_none()
!new.iter()
.any(|(nva, n)| nva == *iva && n.path() == i.path())
})
.map(|(va, i)| (*va, i.clone()))
.collect();
Expand Down
4 changes: 1 addition & 3 deletions src/agent/onefuzz-agent/src/tasks/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ pub async fn download_input(input_url: Url, dst: impl AsRef<Path>) -> Result<Pat
.to_file_path()
.map_err(|_| anyhow!("Invalid file Url"))?;
fs::copy(&input_file_path, &file_path).await?;
Ok(file_path)
} else {
let resp = Client::new()
.get(input_url)
Expand All @@ -41,9 +40,8 @@ pub async fn download_input(input_url: Url, dst: impl AsRef<Path>) -> Result<Pat
let mut writer = io::BufWriter::new(file);

io::copy(&mut body, &mut writer).await?;

Ok(file_path)
}
Ok(file_path)
}

pub async fn reset_tmp_dir(tmp_dir: impl AsRef<Path>) -> Result<()> {
Expand Down
5 changes: 2 additions & 3 deletions src/agent/onefuzz/src/libfuzzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,10 @@ impl<'a> LibFuzzer<'a> {
}

// check if a max_time is already set
if self
if !self
.options
.iter()
.find(|o| o.starts_with("-max_total_time"))
.is_none()
.any(|o| o.starts_with("-max_total_time"))
{
cmd.arg(format!("-max_total_time={}", DEFAULT_MAX_TOTAL_SECONDS));
}
Expand Down