Silence warnings from ignored Result values

For a few of the locations where error handling is done correctly this
does the right thing.  For most other places it gracefully ignores any
issues which is what the original code did as well.  Errors are
already logged by the called functions in those cases.
This commit is contained in:
Floris Bruynooghe
2019-07-21 00:32:33 +02:00
parent f58b1d66c2
commit 31d2bc7401
12 changed files with 107 additions and 69 deletions

View File

@@ -291,7 +291,7 @@ pub unsafe fn dc_create_or_lookup_nchat_by_contact_id(
&context.sql,
format!("INSERT INTO chats_contacts (chat_id, contact_id) VALUES({}, {})", chat_id, contact_id),
params![],
);
).ok();
}
}
@@ -862,13 +862,15 @@ pub unsafe fn dc_is_contact_in_chat(
.unwrap_or_default() as libc::c_int
}
// Should return Result
pub fn dc_unarchive_chat(context: &Context, chat_id: u32) {
sql::execute(
context,
&context.sql,
"UPDATE chats SET archived=0 WHERE id=?",
params![chat_id as i32],
);
)
.ok();
}
pub unsafe fn dc_send_msg<'a>(
@@ -1658,6 +1660,7 @@ pub fn dc_reset_gossiped_timestamp(context: &Context, chat_id: u32) {
dc_set_gossiped_timestamp(context, chat_id, 0);
}
// Should return Result
pub fn dc_set_gossiped_timestamp(context: &Context, chat_id: u32, timestamp: i64) {
if 0 != chat_id {
info!(
@@ -1670,7 +1673,8 @@ pub fn dc_set_gossiped_timestamp(context: &Context, chat_id: u32, timestamp: i64
&context.sql,
"UPDATE chats SET gossiped_timestamp=? WHERE id=?;",
params![timestamp, chat_id as i32],
);
)
.ok();
} else {
info!(
context,
@@ -1681,7 +1685,8 @@ pub fn dc_set_gossiped_timestamp(context: &Context, chat_id: u32, timestamp: i64
&context.sql,
"UPDATE chats SET gossiped_timestamp=?;",
params![timestamp],
);
)
.ok();
}
}
@@ -1764,6 +1769,7 @@ pub unsafe fn dc_remove_contact_from_chat(
success
}
// Should return Result
pub fn dc_set_group_explicitly_left(context: &Context, grpid: *const libc::c_char) {
if 0 == dc_is_group_explicitly_left(context, grpid) {
sql::execute(
@@ -1771,7 +1777,8 @@ pub fn dc_set_group_explicitly_left(context: &Context, grpid: *const libc::c_cha
&context.sql,
"INSERT INTO leftgrps (grpid) VALUES(?);",
params![as_str(grpid)],
);
)
.ok();
}
}