properly fix the QueryReturnedNoRows warning and rustfmt

This commit is contained in:
holger krekel
2019-07-22 11:12:40 +02:00
parent cd7630360f
commit 7a19963879
2 changed files with 11 additions and 13 deletions

View File

@@ -152,6 +152,16 @@ pub fn dc_chat_load_from_db(chat: *mut Chat, chat_id: u32) -> bool {
);
match res {
Err(crate::error::Error::Sql(rusqlite::Error::QueryReturnedNoRows)) => false,
Err(err) => match err {
_ => {
error!(
context,
0, "chat: failed to load from db {}: {:?}", chat_id, err
);
false
}
},
Ok(_) => {
let c = unsafe { &mut *chat };
match c.id {
@@ -184,16 +194,6 @@ pub fn dc_chat_load_from_db(chat: *mut Chat, chat_id: u32) -> bool {
}
true
}
Err(err) => match err {
QueryReturnedNoRows => false,
_ => {
error!(
context,
0, "chat: failed to load from db {}: {:?}", chat_id, err
);
false
}
},
}
}