aboutsummaryrefslogtreecommitdiff
path: root/src/statistics/trackers.rs
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2018-05-31 16:05:52 +0200
committerDaniel Schadt <kingdread@gmx.de>2018-05-31 16:05:52 +0200
commit2d8c0f26c71e90e30d8aef35f7ae95003abf13d6 (patch)
treefeb1b11fbc1409214c7ef23299df9ea813888f6e /src/statistics/trackers.rs
parent4f3aa33ad3c7012105ef897da62220131ac9289c (diff)
downloadevtclib-2d8c0f26c71e90e30d8aef35f7ae95003abf13d6.tar.gz
evtclib-2d8c0f26c71e90e30d8aef35f7ae95003abf13d6.tar.bz2
evtclib-2d8c0f26c71e90e30d8aef35f7ae95003abf13d6.zip
cargo fmt
Diffstat (limited to 'src/statistics/trackers.rs')
-rw-r--r--src/statistics/trackers.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/statistics/trackers.rs b/src/statistics/trackers.rs
index b64e586..2783285 100644
--- a/src/statistics/trackers.rs
+++ b/src/statistics/trackers.rs
@@ -272,7 +272,8 @@ impl BoonTracker {
for (agent, queues) in &self.boon_queues {
for (buff_id, queue) in queues {
let current_stacks = queue.current_stacks();
- let area = self.boon_areas
+ let area = self
+ .boon_areas
.entry(*agent)
.or_insert_with(Default::default)
.entry(*buff_id)
@@ -283,7 +284,8 @@ impl BoonTracker {
}
fn update_next_update(&mut self) {
- let next_update = self.boon_queues
+ let next_update = self
+ .boon_queues
.values()
.flat_map(HashMap::values)
.map(BoonQueue::next_update)
@@ -301,7 +303,8 @@ impl BoonTracker {
/// * `buff_id` - The buff (or condition) id.
fn get_queue(&mut self, agent: u64, buff_id: u16) -> Option<&mut BoonQueue> {
use std::collections::hash_map::Entry;
- let mut entry = self.boon_queues
+ let mut entry = self
+ .boon_queues
.entry(agent)
.or_insert_with(Default::default)
.entry(buff_id);
@@ -310,15 +313,13 @@ impl BoonTracker {
Entry::Occupied(e) => Some(e.into_mut()),
// Queue needs to be created, but only if we know about that boon.
Entry::Vacant(e) => {
- let boon_queue = gamedata::get_boon(buff_id)
- .map(gamedata::Boon::create_queue);
+ let boon_queue = gamedata::get_boon(buff_id).map(gamedata::Boon::create_queue);
if let Some(queue) = boon_queue {
Some(e.insert(queue))
} else {
None
}
}
-
}
}
}