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

Commit 4c9a9f2

Browse files
authored
address issues from latest clippy (#1018)
1 parent 27b434e commit 4c9a9f2

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

src/agent/coverage/src/block/linux.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,8 @@ impl LoadEvents {
350350
let loaded: Vec<_> = new
351351
.iter()
352352
.filter(|(nva, n)| {
353-
old.iter()
354-
.find(|(iva, i)| nva == iva && n.path() == i.path())
355-
.is_none()
353+
!old.iter()
354+
.any(|(iva, i)| *nva == iva && n.path() == i.path())
356355
})
357356
.map(|(va, i)| (*va, i.clone()))
358357
.collect();
@@ -361,9 +360,8 @@ impl LoadEvents {
361360
let unloaded: Vec<_> = old
362361
.iter()
363362
.filter(|(iva, i)| {
364-
new.iter()
365-
.find(|(nva, n)| nva == iva && n.path() == i.path())
366-
.is_none()
363+
!new.iter()
364+
.any(|(nva, n)| nva == *iva && n.path() == i.path())
367365
})
368366
.map(|(va, i)| (*va, i.clone()))
369367
.collect();

src/agent/onefuzz-agent/src/tasks/utils.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ pub async fn download_input(input_url: Url, dst: impl AsRef<Path>) -> Result<Pat
1919
.to_file_path()
2020
.map_err(|_| anyhow!("Invalid file Url"))?;
2121
fs::copy(&input_file_path, &file_path).await?;
22-
Ok(file_path)
2322
} else {
2423
let resp = Client::new()
2524
.get(input_url)
@@ -41,9 +40,8 @@ pub async fn download_input(input_url: Url, dst: impl AsRef<Path>) -> Result<Pat
4140
let mut writer = io::BufWriter::new(file);
4241

4342
io::copy(&mut body, &mut writer).await?;
44-
45-
Ok(file_path)
4643
}
44+
Ok(file_path)
4745
}
4846

4947
pub async fn reset_tmp_dir(tmp_dir: impl AsRef<Path>) -> Result<()> {

src/agent/onefuzz/src/libfuzzer.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,10 @@ impl<'a> LibFuzzer<'a> {
109109
}
110110

111111
// check if a max_time is already set
112-
if self
112+
if !self
113113
.options
114114
.iter()
115-
.find(|o| o.starts_with("-max_total_time"))
116-
.is_none()
115+
.any(|o| o.starts_with("-max_total_time"))
117116
{
118117
cmd.arg(format!("-max_total_time={}", DEFAULT_MAX_TOTAL_SECONDS));
119118
}

0 commit comments

Comments
 (0)