Commit 3b21022ee7

3b21022ee794b58acbef81f20c3950d145626df0

parent: 0db137a142

Unsigned

Damir Jelić <poljar@termina.org.uk> · 2020-01-12 17:16 UTC

server: Remove an unused thread message type.

Layout: unified · split

src/server.rs +1 −3
@@ -43,7 +43,6 @@ pub enum ServerError {
43} 43}
44 44
45pub enum ServerMessage { 45pub enum ServerMessage {
46 ShutDown,
47 RoomSend(String, String), 46 RoomSend(String, String),
48} 47}
49 48
@@ -222,7 +221,7 @@ impl Drop for MatrixServer {
222 let option_name = &format!("{}.{}", self.name(), option_name); 221 let option_name = &format!("{}.{}", self.name(), option_name);
223 section 222 section
224 .free_option(option_name) 223 .free_option(option_name)
225 .expect(&format!("Can't free option {}", option_name)); 224 .unwrap_or_else(|_| panic!(format!("Can't free option {}", option_name)));
226 } 225 }
227 } 226 }
228} 227}
@@ -496,7 +495,6 @@ impl MatrixServer {
496 ) { 495 ) {
497 while let Some(message) = channel.recv().await { 496 while let Some(message) = channel.recv().await {
498 match message { 497 match message {
499 ServerMessage::ShutDown => return,
500 ServerMessage::RoomSend(room_id, message) => { 498 ServerMessage::RoomSend(room_id, message) => {
501 let content = 499 let content =
502 MessageEventContent::Text(TextMessageEventContent { 500 MessageEventContent::Text(TextMessageEventContent {