cargo fmt

This commit is contained in:
Simon Laux
2020-02-09 12:25:47 +01:00
parent 621f1df913
commit d73d021e3c

View File

@@ -1921,7 +1921,7 @@ pub fn shall_attach_selfavatar(context: &Context, chat_id: ChatId) -> Result<boo
pub enum MuteDuration { pub enum MuteDuration {
NotMuted, NotMuted,
Forever, Forever,
Until(i64) Until(i64),
} }
impl rusqlite::types::ToSql for MuteDuration { impl rusqlite::types::ToSql for MuteDuration {
@@ -2877,23 +2877,13 @@ mod tests {
false false
); );
// Timed in the future // Timed in the future
set_muted( set_muted(&t.ctx, chat_id, MuteDuration::Until(time() + 3600)).unwrap();
&t.ctx,
chat_id,
MuteDuration::Until(time() + 3600),
)
.unwrap();
assert_eq!( assert_eq!(
Chat::load_from_db(&t.ctx, chat_id).unwrap().is_muted(), Chat::load_from_db(&t.ctx, chat_id).unwrap().is_muted(),
true true
); );
// Time in the past // Time in the past
set_muted( set_muted(&t.ctx, chat_id, MuteDuration::Until(time() - 3600)).unwrap();
&t.ctx,
chat_id,
MuteDuration::Until(time() - 3600),
)
.unwrap();
assert_eq!( assert_eq!(
Chat::load_from_db(&t.ctx, chat_id).unwrap().is_muted(), Chat::load_from_db(&t.ctx, chat_id).unwrap().is_muted(),
false false