aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/analyzers/fractals.rs10
-rw-r--r--src/analyzers/helpers.rs7
-rw-r--r--src/lib.rs10
3 files changed, 9 insertions, 18 deletions
diff --git a/src/analyzers/fractals.rs b/src/analyzers/fractals.rs
index 637096a..85063bc 100644
--- a/src/analyzers/fractals.rs
+++ b/src/analyzers/fractals.rs
@@ -18,13 +18,9 @@ pub const AI_HAS_DARK_MODE_SKILL: u32 = 61_356;
/// If the whole log is in dark phase, `Some(0)` is returned.
fn get_dark_phase_start(log: &Log) -> Option<u64> {
// Determine if we even have a dark phase.
- if !log.events().iter().any(|event| {
- if let EventKind::SkillUse { skill_id, .. } = event.kind() {
- *skill_id == AI_HAS_DARK_MODE_SKILL
- } else {
- false
- }
- }) {
+ if !log.events().iter().any(|event|
+ matches!(event.kind(), EventKind::SkillUse { skill_id, ..} if *skill_id == AI_HAS_DARK_MODE_SKILL)
+ ) {
return None;
};
diff --git a/src/analyzers/helpers.rs b/src/analyzers/helpers.rs
index 674d752..b5042aa 100644
--- a/src/analyzers/helpers.rs
+++ b/src/analyzers/helpers.rs
@@ -29,10 +29,9 @@ pub fn boss_health(log: &Log) -> Option<u64> {
/// Death is determined by checking for the [`EventKind::ChangeDead`][EventKind::ChangeDead] event,
/// and whether a NPC is a boss is determined by the [`Log::is_boss`][Log::is_boss] method.
pub fn boss_is_dead(log: &Log) -> bool {
- log.events().iter().any(|ev| match ev.kind() {
- EventKind::ChangeDead { agent_addr } if log.is_boss(*agent_addr) => true,
- _ => false,
- })
+ log.events().iter().any(
+ |ev| matches!(ev.kind(), EventKind::ChangeDead { agent_addr } if log.is_boss(*agent_addr)),
+ )
}
/// Checks whether the players exit combat after the boss.
diff --git a/src/lib.rs b/src/lib.rs
index babfc34..0c934ec 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -900,13 +900,9 @@ impl Log {
/// [`Analyzer::outcome`][Analyzer::outcome] method, which does more sophisticated checks
/// (dependent on the boss).
pub fn was_rewarded(&self) -> bool {
- self.events().iter().any(|e| {
- if let EventKind::Reward { .. } = e.kind() {
- true
- } else {
- false
- }
- })
+ self.events()
+ .iter()
+ .any(|e| matches!(e.kind(), EventKind::Reward { .. }))
}
/// Returns all error strings that were captured.