mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-24 23:57:38 +01:00
fix clippy
This commit is contained in:
parent
5ccefb8333
commit
f6c4701932
1 changed files with 9 additions and 9 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue