@@ -138,7 +138,7 @@ impl Shared {
138
138
139
139
/// Send a `LineCodec` encoded message to every peer, except
140
140
/// for the sender.
141
- async fn broadcast ( & mut self , sender : SocketAddr , message : & str ) {
141
+ fn broadcast ( & mut self , sender : SocketAddr , message : & str ) {
142
142
for peer in & mut self . peers {
143
143
if * peer. 0 != sender {
144
144
let _ = peer. 1 . send ( message. into ( ) ) ;
@@ -192,7 +192,7 @@ async fn process(
192
192
let mut state = state. lock ( ) . await ;
193
193
let msg = format ! ( "{username} has joined the chat" ) ;
194
194
tracing:: info!( "{}" , msg) ;
195
- state. broadcast ( addr, & msg) . await ;
195
+ state. broadcast ( addr, & msg) ;
196
196
}
197
197
198
198
// Process incoming messages until our stream is exhausted by a disconnect.
@@ -209,7 +209,7 @@ async fn process(
209
209
let mut state = state. lock( ) . await ;
210
210
let msg = format!( "{username}: {msg}" ) ;
211
211
212
- state. broadcast( addr, & msg) . await ;
212
+ state. broadcast( addr, & msg) ;
213
213
}
214
214
// An error occurred.
215
215
Some ( Err ( e) ) => {
@@ -233,7 +233,7 @@ async fn process(
233
233
234
234
let msg = format ! ( "{username} has left the chat" ) ;
235
235
tracing:: info!( "{}" , msg) ;
236
- state. broadcast ( addr, & msg) . await ;
236
+ state. broadcast ( addr, & msg) ;
237
237
}
238
238
239
239
Ok ( ( ) )
0 commit comments