forked from lavina/lavina
1
0
Fork 0

don't use clojures, just clone an actual string

This commit is contained in:
homycdev 2024-03-13 23:59:49 +03:00
parent 47937c236a
commit ff16a4f1b8
1 changed files with 4 additions and 4 deletions

View File

@ -393,14 +393,14 @@ async fn handle_registered_socket<'a>(
let player_id = PlayerId::from(user.nickname.clone())?;
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 {
tags: vec![],
sender: Some(config.server_name.clone()),
body: ServerMessageBody::N001Welcome {
client: user.nickname.clone(),
text: text(&config.server_name),
text: text.clone(),
},
}
.write_async(writer)
@ -410,7 +410,7 @@ async fn handle_registered_socket<'a>(
sender: Some(config.server_name.clone()),
body: ServerMessageBody::N002YourHost {
client: user.nickname.clone(),
text: text(&config.server_name),
text: text.clone(),
},
}
.write_async(writer)
@ -420,7 +420,7 @@ async fn handle_registered_socket<'a>(
sender: Some(config.server_name.clone()),
body: ServerMessageBody::N003Created {
client: user.nickname.clone(),
text: text(&config.server_name),
text: text.clone(),
},
}
.write_async(writer)