Skip to content

Commit

Permalink
Replace match by map_or_else
Browse files Browse the repository at this point in the history
  • Loading branch information
cruessler committed Jun 20, 2024
1 parent b64a25f commit e7568e4
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions asyncgit/src/revlog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,21 +200,25 @@ impl AsyncLog {
sender: &Sender<AsyncGitNotification>,
filter: Option<SharedCommitFilterFn>,
) -> Result<()> {
match filter {
Some(filter) => Self::fetch_helper_with_filter(
repo_path,
arc_current,
arc_background,
sender,
filter,
),
None => Self::fetch_helper_without_filter(
repo_path,
arc_current,
arc_background,
sender,
),
}
filter.map_or_else(
|| {
Self::fetch_helper_without_filter(
repo_path,
arc_current,
arc_background,
sender,
)
},
|filter| {
Self::fetch_helper_with_filter(
repo_path,
arc_current,
arc_background,
sender,
filter,
)
},
)
}

fn fetch_helper_with_filter(
Expand Down

0 comments on commit e7568e4

Please sign in to comment.