diff options
| author | Jokler <jokler@protonmail.com> | 2020-08-19 03:38:48 +0200 |
|---|---|---|
| committer | Jokler <jokler@protonmail.com> | 2020-08-19 03:38:48 +0200 |
| commit | 237e0c4fb48d9694c263f703a42f7790a99368ef (patch) | |
| tree | cd7f8351d92a2cd58c3eff08164a2eb7070d65f3 /src/bot/master.rs | |
| parent | 681950517d511d1c4b8e465f9b9758c027ecd6bf (diff) | |
| download | pokebot-237e0c4fb48d9694c263f703a42f7790a99368ef.tar.gz pokebot-237e0c4fb48d9694c263f703a42f7790a99368ef.zip | |
Run clippy and fmt
Diffstat (limited to 'src/bot/master.rs')
| -rw-r--r-- | src/bot/master.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bot/master.rs b/src/bot/master.rs index 4cdb490..7612c68 100644 --- a/src/bot/master.rs +++ b/src/bot/master.rs @@ -119,7 +119,7 @@ impl MasterBot { ref connected_bots, } = &mut *self.music_bots.write().expect("RwLock was not poisoned"); - for (_, bot) in connected_bots { + for bot in connected_bots.values() { if bot.my_channel() == channel { return Err(BotCreationError::MultipleBots(bot.name().to_owned())); } @@ -209,7 +209,7 @@ impl MasterBot { let bot = music_bots.connected_bots.get(&name)?; Some(crate::web_server::BotData { - name: name, + name, state: bot.state(), volume: bot.volume(), position: bot.position(), @@ -244,7 +244,7 @@ impl MasterBot { let len = music_bots.connected_bots.len(); let mut result = Vec::with_capacity(len); - for (name, _) in &music_bots.connected_bots { + for name in music_bots.connected_bots.keys() { result.push(name.clone()); } @@ -253,7 +253,7 @@ impl MasterBot { pub fn quit(&self, reason: String) { let music_bots = self.music_bots.read().unwrap(); - for (_, bot) in &music_bots.connected_bots { + for bot in music_bots.connected_bots.values() { bot.quit(reason.clone()) } let sender = self.sender.read().unwrap(); |
