refactor: format
This commit is contained in:
@@ -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,
|
||||
)
|
||||
};
|
||||
|
||||
|
||||
@@ -62,7 +62,10 @@ impl EventHandler for MixerBot {
|
||||
let data = ctx.data.read().await;
|
||||
let db = data.get::<DatabaseContainer>().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;
|
||||
|
||||
@@ -11,7 +11,12 @@ pub struct ImageGenerator<'a> {
|
||||
}
|
||||
|
||||
impl<'a> ImageGenerator<'a> {
|
||||
pub fn draw_teams_to_vec(&self, player_names: Vec<String>, teams_rating: [i32; 2], format: ImageOutputFormat) -> Vec<u8> {
|
||||
pub fn draw_teams_to_vec(
|
||||
&self,
|
||||
player_names: Vec<String>,
|
||||
teams_rating: [i32; 2],
|
||||
format: ImageOutputFormat,
|
||||
) -> Vec<u8> {
|
||||
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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user