Skip to content

Commit

Permalink
Change clone to ref for listen_changes
Browse files Browse the repository at this point in the history
  • Loading branch information
abdolence committed Feb 6, 2023
1 parent df2b6a4 commit 6b033e8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/db/listen_changes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ where

pub async fn start<FN, F>(&mut self, cb: FN) -> FirestoreResult<()>
where
FN: Fn(FirestoreListenEvent, D) -> F + Send + Sync + 'static,
FN: Fn(FirestoreListenEvent, &D) -> F + Send + Sync + 'static,
F: Future<Output = BoxedErrResult<()>> + Send + 'static,
{
info!(
Expand Down Expand Up @@ -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<Output = BoxedErrResult<()>> + Send,
{
while !shutdown_flag.load(Ordering::Relaxed) {
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 6b033e8

Please sign in to comment.