aboutsummaryrefslogtreecommitdiffstats
path: root/mumlib/src/state.rs
diff options
context:
space:
mode:
authorEskil Queseth <eskilq@kth.se>2020-11-05 00:44:48 +0100
committerEskil Queseth <eskilq@kth.se>2020-11-05 00:44:48 +0100
commit7a4e0c79be76444a8f3a8d4019175a8eb84d333e (patch)
treeff4277bdeafd4aaf1c18a6d80c14ddc1c529ac89 /mumlib/src/state.rs
parent22579ced3d1d847a14683fe3b47fa2076df01751 (diff)
downloadmum-7a4e0c79be76444a8f3a8d4019175a8eb84d333e.tar.gz
cargo fmt
Diffstat (limited to 'mumlib/src/state.rs')
-rw-r--r--mumlib/src/state.rs25
1 files changed, 17 insertions, 8 deletions
diff --git a/mumlib/src/state.rs b/mumlib/src/state.rs
index 0540f14..3b1da56 100644
--- a/mumlib/src/state.rs
+++ b/mumlib/src/state.rs
@@ -131,18 +131,27 @@ pub struct User {
}
macro_rules! true_to_str {
- ($condition:expr, $res:expr) => {if $condition { $res } else { "" }};
+ ($condition:expr, $res:expr) => {
+ if $condition {
+ $res
+ } else {
+ ""
+ }
+ };
}
impl Display for User {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
- write!(f, "{} {}{}{}{}{}",
- self.name,
- true_to_str!(self.suppress, "s"),
- true_to_str!(self.self_mute, "M"),
- true_to_str!(self.self_deaf, "D"),
- true_to_str!(self.mute, "m"),
- true_to_str!(self.deaf, "d"))
+ write!(
+ f,
+ "{} {}{}{}{}{}",
+ self.name,
+ true_to_str!(self.suppress, "s"),
+ true_to_str!(self.self_mute, "M"),
+ true_to_str!(self.self_deaf, "D"),
+ true_to_str!(self.mute, "m"),
+ true_to_str!(self.deaf, "d")
+ )
}
}