Skip to content

Commit

Permalink
Update for new clippy lint about map_or
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldjeffrey committed Jan 9, 2025
1 parent 29e8499 commit 530c315
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion file_store/src/file_sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ mod tests {
.file_name()
.to_str()
.and_then(|file_name| FileInfo::from_str(file_name).ok())
.map_or(false, |file_info| {
.is_some_and(|file_info| {
FileType::from_str(&file_info.prefix).expect("entropy report prefix")
== FileType::EntropyReport
})
Expand Down
7 changes: 3 additions & 4 deletions iot_verifier/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ where
.witness_updater
.get_last_witness(&beacon_report.report.pub_key)
.await?;
Ok(last_witness.map_or(false, |lw| {
Ok(last_witness.is_some_and(|lw| {
beacon_report.received_timestamp - lw.timestamp < *RECIPROCITY_WINDOW
}))
}
Expand Down Expand Up @@ -544,9 +544,8 @@ where
) -> anyhow::Result<bool> {
let last_beacon_recip =
LastBeaconReciprocity::get(&self.pool, &report.report.pub_key).await?;
Ok(last_beacon_recip.map_or(false, |lw| {
report.received_timestamp - lw.timestamp < *RECIPROCITY_WINDOW
}))
Ok(last_beacon_recip
.is_some_and(|lw| report.received_timestamp - lw.timestamp < *RECIPROCITY_WINDOW))
}
}

Expand Down

0 comments on commit 530c315

Please sign in to comment.