koffice: fix cass issue where only the first session would work

wip/yesman
Katharina Fey 3 years ago
parent 5d61126be1
commit 34e3e84eb4
Signed by: kookie
GPG Key ID: 90734A9E619C8A6C
  1. 11
      apps/koffice/libko/src/cass/timeline.rs

@ -41,14 +41,11 @@ impl Timeline {
fn last_session(&mut self) -> Option<&mut Session> {
self.inner
.iter_mut()
.find(|e| match e {
Entry::Session(_) => true,
_ => false,
})
.map(|e| match e {
Entry::Session(ref mut s) => s,
_ => unreachable!(),
.filter_map(|e| match e {
Entry::Session(s) => Some(s),
_ => None,
})
.last()
}
/// Utility function to get the last invoice in the timeline

Loading…
Cancel
Save