Skip to content

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Nashtare committed Dec 2, 2024
1 parent 7eb3fc3 commit 28b6121
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions eth_test_parser/src/fs_scaffolding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ pub(crate) fn prepare_output_dir(out_path: &Path) -> Result<()> {

/// Generate an iterator containing the deserialized test bodies (`TestBody`)
/// and their `DirEntry`s.
#[allow(clippy::type_complexity)]
pub(crate) fn get_deserialized_test_bodies(
) -> Result<impl Iterator<Item = Result<(DirEntry, Vec<TestBody>), (String, String)>>> {
Ok(get_test_files()?.map(|entry| {
Expand Down
2 changes: 1 addition & 1 deletion evm_test_runner/src/persistent_run_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ pub(crate) enum PassState {

impl PassState {
// Utility method to filter out passed tests from previous runs.
fn get_passed_status(&self, witness_only: bool) -> bool {
const fn get_passed_status(&self, witness_only: bool) -> bool {
if witness_only {
matches!(
self,
Expand Down
2 changes: 1 addition & 1 deletion evm_test_runner/src/plonky2_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ impl Display for TestStatus {
}

impl TestStatus {
pub(crate) fn passed(&self) -> bool {
pub(crate) const fn passed(&self) -> bool {
matches!(self, Self::PassedProof | Self::PassedWitness)
}
}
Expand Down
4 changes: 2 additions & 2 deletions evm_test_runner/src/test_dir_reading.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,14 @@ async fn parse_test_sub_group(
}

fn blacklisted(blacklist: Option<&HashSet<String>>, t_name: &str) -> bool {
blacklist.map_or(false, |b_list| b_list.contains(t_name))
blacklist.is_some_and(|b_list| b_list.contains(t_name))
}

fn test_is_not_in_filter_str(filter_str: &Option<String>, file_path: &Path) -> bool {
filter_str.as_ref().map_or(false, |f_str| {

Check failure on line 164 in evm_test_runner/src/test_dir_reading.rs

View workflow job for this annotation

GitHub Actions / Formatting and Clippy

this `map_or` can be simplified
file_path
.to_str()
.map_or(false, |p_str| !p_str.contains(f_str))
.is_some_and(|p_str| !p_str.contains(f_str))
})
}

Expand Down

0 comments on commit 28b6121

Please sign in to comment.