Changed an argument to a reference
This commit is contained in:
parent
f29aca941b
commit
bb2122db6b
5 changed files with 8 additions and 8 deletions
|
@ -187,8 +187,8 @@ impl CalDavSource<CachedCalendar> for Cache {
|
|||
)
|
||||
}
|
||||
|
||||
async fn get_calendar(&self, id: CalendarId) -> Option<Arc<Mutex<CachedCalendar>>> {
|
||||
self.data.calendars.get(&id).map(|arc| arc.clone())
|
||||
async fn get_calendar(&self, id: &CalendarId) -> Option<Arc<Mutex<CachedCalendar>>> {
|
||||
self.data.calendars.get(id).map(|arc| arc.clone())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -220,11 +220,11 @@ impl CalDavSource<RemoteCalendar> for Client {
|
|||
}
|
||||
|
||||
|
||||
async fn get_calendar(&self, id: CalendarId) -> Option<Arc<Mutex<RemoteCalendar>>> {
|
||||
async fn get_calendar(&self, id: &CalendarId) -> Option<Arc<Mutex<RemoteCalendar>>> {
|
||||
self.cached_replies.lock().unwrap()
|
||||
.calendars
|
||||
.as_ref()
|
||||
.and_then(|cals| cals.get(&id))
|
||||
.and_then(|cals| cals.get(id))
|
||||
.map(|cal| cal.clone())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ where
|
|||
for (id, cal_server) in cals_server {
|
||||
let mut cal_server = cal_server.lock().unwrap();
|
||||
|
||||
let cal_local = match self.local.get_calendar(id).await {
|
||||
let cal_local = match self.local.get_calendar(&id).await {
|
||||
None => {
|
||||
log::error!("TODO: implement here");
|
||||
continue;
|
||||
|
|
|
@ -15,7 +15,7 @@ pub trait CalDavSource<T: PartialCalendar> {
|
|||
/// This function may trigger an update (that can be a long process, or that can even fail, e.g. in case of a remote server)
|
||||
async fn get_calendars(&self) -> Result<HashMap<CalendarId, Arc<Mutex<T>>>, Box<dyn Error>>;
|
||||
/// Returns the calendar matching the ID
|
||||
async fn get_calendar(&self, id: CalendarId) -> Option<Arc<Mutex<T>>>;
|
||||
async fn get_calendar(&self, id: &CalendarId) -> Option<Arc<Mutex<T>>>;
|
||||
}
|
||||
|
||||
pub trait SyncSlave {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue