aboutsummaryrefslogtreecommitdiffstats
path: root/mumd/src/state.rs
diff options
context:
space:
mode:
Diffstat (limited to 'mumd/src/state.rs')
-rw-r--r--mumd/src/state.rs20
1 files changed, 11 insertions, 9 deletions
diff --git a/mumd/src/state.rs b/mumd/src/state.rs
index b279dfd..f725276 100644
--- a/mumd/src/state.rs
+++ b/mumd/src/state.rs
@@ -342,16 +342,18 @@ impl State {
accept_invalid_cert,
)))
.unwrap();
- at!(TcpEvent::Connected, |e| {
+ at!(TcpEvent::Connected, |res| {
//runs the closure when the client is connected
- if let TcpEventData::Connected(msg) = e {
- Ok(Some(CommandResponse::ServerConnect {
- welcome_message: if msg.has_welcome_text() {
- Some(msg.get_welcome_text().to_string())
- } else {
- None
- },
- }))
+ if let TcpEventData::Connected(res) = res {
+ res.map(|msg| {
+ Some(CommandResponse::ServerConnect {
+ welcome_message: if msg.has_welcome_text() {
+ Some(msg.get_welcome_text().to_string())
+ } else {
+ None
+ },
+ })
+ })
} else {
unreachable!("callback should be provided with a TcpEventData::Connected");
}