Replace .push_str() calls with += operator to clean up code

This commit is contained in:
Agatha Lovelace 2020-06-21 12:28:13 +03:00
parent 766de88a33
commit 034da120ac
No known key found for this signature in database
GPG Key ID: 2DB18BA2E0A80BC3
1 changed files with 3 additions and 3 deletions

View File

@ -273,7 +273,7 @@ fn servers(ctx: &mut Context, message: &Message) -> CommandResult {
let cache = ctx.cache.read();
for (index, guild_lock) in cache.guilds.values().enumerate() {
let guild = guild_lock.read();
list.push_str(&format!("{}: {}\n", index, guild.name));
list += &format!("{}: {}\n", index, guild.name);
}
let _ = message
.channel_id
@ -434,7 +434,7 @@ fn bottom_rng(ctx: &mut Context, message: &Message, mut args: Args) -> CommandRe
messages.retain(|v| v.author != message.mentions[0]);
let mut input = String::new();
for msg in messages {
input.push_str(&format!("{} ", msg.content));
input += &format!("{} ", msg.content);
}
let result: u64 = StdRng::seed_from_u64(calculate_hash(&input)).gen_range(0, 100);
let _ = message.channel_id.send_message(&ctx.http, |m| {
@ -475,7 +475,7 @@ fn ship(ctx: &mut Context, message: &Message, args: Args) -> CommandResult {
_ => {
let mut first_halves = String::new();
for name in &names[0..names.len() - 1] {
first_halves.push_str(&name[0..name.len() / 2]);
first_halves += &name[0..name.len() / 2];
}
let first_halves = first_halves.as_str();
let last_half = &names[names.len() - 1][(names.len() / 2) + 1..];