small changes to resource allocation, marginally increasing efficiency

This commit is contained in:
djaidjai committed 2023-05-12 15:33:19 +02:00
1 parent e3e4953560
commit 723808cf1d
3 files changed
+11 -11

No files matched your search

+2 -2
View File
@@ -16,10 +16,10 @@ use crate::structs::{data::Data, config::Config};
/// name: name of active player, to fetch the appropriate prefix from cfg.
fn update_prefix(cfg: &Config, data: &mut char, name: &str) {
if let Some(char) = cfg.player_prefixes.get(name) {
*data = char.clone();
*data = *char;
trace!("updated prefix to {}", data);
} else {
*data = cfg.player_prefixes.get("default").unwrap_or(&'>').clone();
*data = *cfg.player_prefixes.get("default").unwrap_or(&'>');
trace!("set prefix to default ({})", data);
}
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.