Skip to content

Commit 0d441cd

Browse files
committed
feat: remove Sync bounds
1 parent 0f478d5 commit 0d441cd

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

concurrency/src/tasks/gen_server.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ pub enum InitResult<G: GenServer> {
135135
}
136136

137137
pub trait GenServer: Send + Sized {
138-
type CallMsg: Send + Sized + Sync;
139-
type CastMsg: Send + Sized + Sync;
138+
type CallMsg: Send + Sized;
139+
type CastMsg: Send + Sized;
140140
type OutMsg: Send + Sized;
141141
type Error: Debug + Send;
142142

concurrency/src/tasks/time.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,11 @@ where
6262
let genserver_cancel_fut = pin!(gen_server_cancellation_token.cancelled());
6363
let cancel_conditions = select(cancel_token_fut, genserver_cancel_fut);
6464

65-
let async_block = pin!(async {
65+
let message_clone = message.clone();
66+
let handle_reference = &mut handle;
67+
let async_block = pin!(async move {
6668
rt::sleep(period).await;
67-
let _ = handle.cast(message.clone()).await;
69+
let _ = handle_reference.cast(message_clone).await;
6870
});
6971
let result = select(cancel_conditions, async_block).await;
7072
match result {

0 commit comments

Comments
 (0)