Trait is closer to what caldav servers provide
This commit is contained in:
parent
7af147e417
commit
86f3566532
11 changed files with 122 additions and 94 deletions
11
src/cache.rs
11
src/cache.rs
|
@ -14,7 +14,6 @@ use async_trait::async_trait;
|
|||
use chrono::{DateTime, Utc};
|
||||
|
||||
use crate::traits::CalDavSource;
|
||||
use crate::traits::SyncSlave;
|
||||
use crate::traits::PartialCalendar;
|
||||
use crate::traits::CompleteCalendar;
|
||||
use crate::calendar::cached_calendar::CachedCalendar;
|
||||
|
@ -192,16 +191,6 @@ impl CalDavSource<CachedCalendar> for Cache {
|
|||
}
|
||||
}
|
||||
|
||||
impl SyncSlave for Cache {
|
||||
fn get_last_sync(&self) -> Option<DateTime<Utc>> {
|
||||
self.data.last_sync
|
||||
}
|
||||
|
||||
fn update_last_sync(&mut self, timepoint: Option<DateTime<Utc>>) {
|
||||
self.data.last_sync = Some(timepoint.unwrap_or_else(|| Utc::now()));
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue