From aefead4a31e427aa05096ff5c1758a4d1565a4c9 Mon Sep 17 00:00:00 2001 From: Isse Date: Sat, 28 Jan 2023 03:08:20 +0100 Subject: [PATCH] fmt --- voxygen/i18n-helpers/src/lib.rs | 6 +----- voxygen/src/hud/chat.rs | 24 ++++++++++++++++++------ 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/voxygen/i18n-helpers/src/lib.rs b/voxygen/i18n-helpers/src/lib.rs index 181a0c2e3e..6323c43971 100644 --- a/voxygen/i18n-helpers/src/lib.rs +++ b/voxygen/i18n-helpers/src/lib.rs @@ -219,10 +219,6 @@ fn insert_alias(you: bool, info: PlayerInfo, localisation: &Localization) -> Str (false, false) => info.player_alias, (false, true) => localisation.get_msg(YOU).to_string(), (true, false) => format!("{}{}", MOD_SPACING, info.player_alias), - (true, true) => format!( - "{}{}", - MOD_SPACING, - &localisation.get_msg(YOU), - ), + (true, true) => format!("{}{}", MOD_SPACING, &localisation.get_msg(YOU),), } } diff --git a/voxygen/src/hud/chat.rs b/voxygen/src/hud/chat.rs index c7a18b3363..afe095a5d2 100644 --- a/voxygen/src/hud/chat.rs +++ b/voxygen/src/hud/chat.rs @@ -442,14 +442,26 @@ impl<'a> Widget for Chat<'a> { } }) .map(|m| { - let is_moderator = m.chat_type.uid().and_then(|uid| self.client.lookup_msg_context(&m).player_alias.get(&uid).map(|i| i.is_moderator)).unwrap_or(false); + let is_moderator = m + .chat_type + .uid() + .and_then(|uid| { + self.client + .lookup_msg_context(&m) + .player_alias + .get(&uid) + .map(|i| i.is_moderator) + }) + .unwrap_or(false); (is_moderator, m) }) .collect::>(); let n_badges = messages.iter().filter(|t| t.0).count(); if state.ids.chat_badges.len() < n_badges { state.update(|s| { - s.ids.chat_badges.resize(n_badges, &mut ui.widget_id_generator()) + s.ids + .chat_badges + .resize(n_badges, &mut ui.widget_id_generator()) }) } Rectangle::fill_with([CHAT_ICON_WIDTH, CHAT_BOX_HEIGHT], color::TRANSPARENT) @@ -489,10 +501,10 @@ impl<'a> Widget for Chat<'a> { // If the user is a moderator display a moderator icon with their alias. if *is_moderator { Image::new(self.imgs.chat_moderator_badge) - .w_h(CHAT_ICON_WIDTH, CHAT_ICON_HEIGHT) - .top_left_with_margins_on(item.widget_id, 2.0, 7.0) - .parent(state.ids.message_box_bg) - .set(state.ids.chat_badges[badge_id], ui); + .w_h(CHAT_ICON_WIDTH, CHAT_ICON_HEIGHT) + .top_left_with_margins_on(item.widget_id, 2.0, 7.0) + .parent(state.ids.message_box_bg) + .set(state.ids.chat_badges[badge_id], ui); badge_id += 1; }