refactor: use some more let..else

This commit is contained in:
link2xt
2026-05-10 16:09:04 +02:00
committed by l
parent 31c74d82bd
commit fa8fcaaa2b
3 changed files with 12 additions and 18 deletions

View File

@@ -1557,9 +1557,7 @@ pub(crate) async fn get_chat_msg(
asserted_msgs_count,
msgs.len()
);
let msg_id = if let ChatItem::Message { msg_id } = msgs[index] {
msg_id
} else {
let ChatItem::Message { msg_id } = msgs[index] else {
panic!("Wrong item type");
};
Message::load_from_db(&t.ctx, msg_id).await.unwrap()