fix clippy

This commit is contained in:
Maybe Waffle 2021-10-10 15:15:16 +03:00
parent 5ccefb8333
commit f6c4701932

View file

@ -156,15 +156,17 @@ where
match this.senders.pin().get(&chat_id) { match this.senders.pin().get(&chat_id) {
// An old dialogue // An old dialogue
Some(tx) => { Some(tx) => {
if tx.send(cx).is_err() { assert!(
panic!("We are not dropping a receiver or call .close() on it",); tx.send(cx).is_ok(),
} "We are not dropping a receiver or call .close() on it"
);
} }
None => { None => {
let tx = this.new_tx(); let tx = this.new_tx();
if tx.send(cx).is_err() { assert!(
panic!("We are not dropping a receiver or call .close() on it",); tx.send(cx).is_ok(),
} "We are not dropping a receiver or call .close() on it"
);
this.senders.pin().insert(chat_id, tx); this.senders.pin().insert(chat_id, tx);
} }
} }
@ -271,9 +273,7 @@ mod tests {
let tx = tx.clone(); let tx = tx.clone();
async move { async move {
if tx.send(update).is_err() { assert!(tx.send(update).is_ok(), "tx.send(update) failed");
panic!("tx.send(update) failed");
}
} }
}) })
.await; .await;