make clippy happy

This commit is contained in:
B. Petersen
2020-03-09 12:27:55 +01:00
committed by Alexander Krotov
parent be0afdebfd
commit 248e6ea5e7

View File

@@ -1379,9 +1379,8 @@ pub fn estimate_deletion_cnt(
.0; .0;
let threshold_timestamp = time() - seconds; let threshold_timestamp = time() - seconds;
let cnt: isize; let cnt: isize = if from_server {
if from_server { context.sql.query_row(
cnt = context.sql.query_row(
"SELECT COUNT(*) "SELECT COUNT(*)
FROM msgs m FROM msgs m
WHERE m.id > ? WHERE m.id > ?
@@ -1390,9 +1389,9 @@ pub fn estimate_deletion_cnt(
AND server_uid != 0;", AND server_uid != 0;",
params![DC_MSG_ID_LAST_SPECIAL, threshold_timestamp, self_chat_id], params![DC_MSG_ID_LAST_SPECIAL, threshold_timestamp, self_chat_id],
|row| row.get(0), |row| row.get(0),
)?; )?
} else { } else {
cnt = context.sql.query_row( context.sql.query_row(
"SELECT COUNT(*) "SELECT COUNT(*)
FROM msgs m FROM msgs m
WHERE m.id > ? WHERE m.id > ?
@@ -1406,8 +1405,8 @@ pub fn estimate_deletion_cnt(
ChatId::new(DC_CHAT_ID_TRASH) ChatId::new(DC_CHAT_ID_TRASH)
], ],
|row| row.get(0), |row| row.get(0),
)?; )?
} };
Ok(cnt as usize) Ok(cnt as usize)
} }