aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2018-04-23 17:00:14 +0200
committerDaniel Schadt <kingdread@gmx.de>2018-04-23 17:00:14 +0200
commitc6cd5dfef5ca037862c79f7abe460e1b88c8dab4 (patch)
tree5ed70f85bb238184b9f32a9b33b4e721d7dcb1ed /src/lib.rs
parent6165bf6e4cfde199c3bc8bd0b862eb7de309aec3 (diff)
downloadevtclib-c6cd5dfef5ca037862c79f7abe460e1b88c8dab4.tar.gz
evtclib-c6cd5dfef5ca037862c79f7abe460e1b88c8dab4.tar.bz2
evtclib-c6cd5dfef5ca037862c79f7abe460e1b88c8dab4.zip
more documentation
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 3e1aeee..ec57570 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -118,13 +118,17 @@ impl Log {
}
/// Return an iterator over all agents that represent player characters.
- pub fn players(&self) -> impl Iterator<Item=&Agent> {
- self.agents.iter().filter(|a| matches!(a.kind, AgentKind::Player { .. }))
+ pub fn players(&self) -> impl Iterator<Item = &Agent> {
+ self.agents
+ .iter()
+ .filter(|a| matches!(a.kind, AgentKind::Player { .. }))
}
/// Return an iterator over all agents that are NPCs.
- pub fn npcs(&self) -> impl Iterator<Item=&Agent> {
- self.agents.iter().filter(|a| matches!(a.kind, AgentKind::Character(_)))
+ pub fn npcs(&self) -> impl Iterator<Item = &Agent> {
+ self.agents
+ .iter()
+ .filter(|a| matches!(a.kind, AgentKind::Character(_)))
}
/// Return all events present in this log.
@@ -135,7 +139,7 @@ impl Log {
pub fn process(data: &raw::Evtc) -> Result<Log, EvtcError> {
// Prepare "augmented" agents
- let mut agents = setup_agents(data)?;
+ let mut agents = setup_agents(data)?;
// Do the first aware/last aware field
set_agent_awares(data, &mut agents)?;