Fix one clippy::unneeded_unwrap warning

This commit is contained in:
Dmitry Bogatov
2019-08-27 23:06:56 +00:00
parent 0a9f61783d
commit 85e16f6e82

View File

@@ -1563,10 +1563,8 @@ pub unsafe fn remove_contact_from_chat(
/* we do not check if "contact_id" exists but just delete all records with the id from chats_contacts */ /* we do not check if "contact_id" exists but just delete all records with the id from chats_contacts */
/* this allows to delete pending references to deleted contacts. Of course, this should _not_ happen. */ /* this allows to delete pending references to deleted contacts. Of course, this should _not_ happen. */
let chat = Chat::load_from_db(context, chat_id); if let Ok(chat) = Chat::load_from_db(context, chat_id) {
if real_group_exists(context, chat_id) {
if !(!real_group_exists(context, chat_id) || chat.is_err()) {
let chat = chat.unwrap();
if !(is_contact_in_chat(context, chat_id, 1 as u32) == 1) { if !(is_contact_in_chat(context, chat_id, 1 as u32) == 1) {
log_event!( log_event!(
context, context,
@@ -1618,6 +1616,7 @@ pub unsafe fn remove_contact_from_chat(
} }
} }
} }
}
if !success { if !success {
bail!("Failed to remove contact"); bail!("Failed to remove contact");