Clean out last of PlayHandle.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
use crate::{Event, Play, PlayHandle, Team, error};
|
use crate::{Event, Play, Team, error};
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
|
||||||
#[derive(Debug, Deserialize, Clone)]
|
#[derive(Debug, Deserialize, Clone)]
|
||||||
@@ -8,21 +8,6 @@ pub struct Period {
|
|||||||
pub events: Vec<Event>,
|
pub events: Vec<Event>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PlayHandle for Period {
|
|
||||||
fn plays(&self) -> Vec<Play> {
|
|
||||||
self.events
|
|
||||||
.iter()
|
|
||||||
.filter_map(|event| {
|
|
||||||
if let Event::Play(play) = event {
|
|
||||||
Some(play.to_owned())
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.collect()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Period {
|
impl Period {
|
||||||
pub fn team_events(
|
pub fn team_events(
|
||||||
&self,
|
&self,
|
||||||
|
|||||||
Reference in New Issue
Block a user