forked from lavina/lavina
don't use clojures, just clone an actual string
This commit is contained in:
parent
47937c236a
commit
ff16a4f1b8
|
@ -393,14 +393,14 @@ async fn handle_registered_socket<'a>(
|
||||||
|
|
||||||
let player_id = PlayerId::from(user.nickname.clone())?;
|
let player_id = PlayerId::from(user.nickname.clone())?;
|
||||||
let mut connection = players.connect_to_player(player_id.clone()).await;
|
let mut connection = players.connect_to_player(player_id.clone()).await;
|
||||||
let text: fn(&Str) -> Str = |server_name: &Str| format!("Welcome to {} Server", server_name).into();
|
let text: Str = format!("Welcome to {} Server", &config.server_name).into();
|
||||||
|
|
||||||
ServerMessage {
|
ServerMessage {
|
||||||
tags: vec![],
|
tags: vec![],
|
||||||
sender: Some(config.server_name.clone()),
|
sender: Some(config.server_name.clone()),
|
||||||
body: ServerMessageBody::N001Welcome {
|
body: ServerMessageBody::N001Welcome {
|
||||||
client: user.nickname.clone(),
|
client: user.nickname.clone(),
|
||||||
text: text(&config.server_name),
|
text: text.clone(),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
.write_async(writer)
|
.write_async(writer)
|
||||||
|
@ -410,7 +410,7 @@ async fn handle_registered_socket<'a>(
|
||||||
sender: Some(config.server_name.clone()),
|
sender: Some(config.server_name.clone()),
|
||||||
body: ServerMessageBody::N002YourHost {
|
body: ServerMessageBody::N002YourHost {
|
||||||
client: user.nickname.clone(),
|
client: user.nickname.clone(),
|
||||||
text: text(&config.server_name),
|
text: text.clone(),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
.write_async(writer)
|
.write_async(writer)
|
||||||
|
@ -420,7 +420,7 @@ async fn handle_registered_socket<'a>(
|
||||||
sender: Some(config.server_name.clone()),
|
sender: Some(config.server_name.clone()),
|
||||||
body: ServerMessageBody::N003Created {
|
body: ServerMessageBody::N003Created {
|
||||||
client: user.nickname.clone(),
|
client: user.nickname.clone(),
|
||||||
text: text(&config.server_name),
|
text: text.clone(),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
.write_async(writer)
|
.write_async(writer)
|
||||||
|
|
Loading…
Reference in New Issue