diff --git a/mixer-discord-bot/src/bot/commands/lobby.rs b/mixer-discord-bot/src/bot/commands/lobby.rs index 0cb35c6..9792262 100644 --- a/mixer-discord-bot/src/bot/commands/lobby.rs +++ b/mixer-discord-bot/src/bot/commands/lobby.rs @@ -351,7 +351,7 @@ impl LobbyCommand { image_gen.draw_teams_to_vec( player_names, [team1_rank.value as i32, team2_rank.value as i32], - image::ImageOutputFormat::Png + image::ImageOutputFormat::Png, ) }; diff --git a/mixer-discord-bot/src/bot/mod.rs b/mixer-discord-bot/src/bot/mod.rs index 9f0c149..44b3c1d 100644 --- a/mixer-discord-bot/src/bot/mod.rs +++ b/mixer-discord-bot/src/bot/mod.rs @@ -62,7 +62,10 @@ impl EventHandler for MixerBot { let data = ctx.data.read().await; let db = data.get::().unwrap().read().await; - if LobbyQuery::lobby_by_channel_id(db.connection(), guild_id, channel_id).await.is_some() { + if LobbyQuery::lobby_by_channel_id(db.connection(), guild_id, channel_id) + .await + .is_some() + { if let Some(member) = new.member { if member.user.bot { return; diff --git a/mixer-discord-bot/src/image_manipulation.rs b/mixer-discord-bot/src/image_manipulation.rs index 6492193..c644b28 100644 --- a/mixer-discord-bot/src/image_manipulation.rs +++ b/mixer-discord-bot/src/image_manipulation.rs @@ -11,7 +11,12 @@ pub struct ImageGenerator<'a> { } impl<'a> ImageGenerator<'a> { - pub fn draw_teams_to_vec(&self, player_names: Vec, teams_rating: [i32; 2], format: ImageOutputFormat) -> Vec { + pub fn draw_teams_to_vec( + &self, + player_names: Vec, + teams_rating: [i32; 2], + format: ImageOutputFormat, + ) -> Vec { let mut image = self.teams_image.clone(); let player_text_scale = Scale::uniform(60.0); @@ -62,7 +67,6 @@ impl<'a> ImageGenerator<'a> { ); } - let mut buf = Cursor::new(Vec::new()); image.write_to(&mut buf, format).unwrap();