diff --git a/src/db/listen_changes.rs b/src/db/listen_changes.rs index de0a9ff..90552f7 100644 --- a/src/db/listen_changes.rs +++ b/src/db/listen_changes.rs @@ -227,7 +227,7 @@ where pub async fn start(&mut self, cb: FN) -> FirestoreResult<()> where - FN: Fn(FirestoreListenEvent, D) -> F + Send + Sync + 'static, + FN: Fn(FirestoreListenEvent, &D) -> F + Send + Sync + 'static, F: Future> + Send + 'static, { info!( @@ -296,7 +296,7 @@ where cb: FN, ) where D: FirestoreListenSupport + Clone + Send + Sync, - FN: Fn(FirestoreListenEvent, D) -> F + Send + Sync, + FN: Fn(FirestoreListenEvent, &D) -> F + Send + Sync, F: Future> + Send, { while !shutdown_flag.load(Ordering::Relaxed) { @@ -342,7 +342,7 @@ where } Some(response_type) => { - if let Err(err) = cb(response_type, db.clone()).await { + if let Err(err) = cb(response_type, &db).await { error!("Listener callback function error occurred {:?}.", err); break; }