WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit ad58607

Browse files
jplattepoljar
authored andcommitted
Fix new clippy lints
1 parent eae3006 commit ad58607

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

crates/matrix-sdk-sqlite/src/error.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,15 @@ macro_rules! impl_from {
124124

125125
impl From<rusqlite::Error> for Error {
126126
fn from(error: rusqlite::Error) -> Self {
127-
if let rusqlite::Error::SqliteFailure(ffi_error, message) = &error {
128-
if ffi_error.code == rusqlite::ErrorCode::DatabaseBusy {
129-
// Report to sentry.
130-
tracing::error!(
131-
sentry = true,
132-
sqlite_message = message,
133-
"observed database busy error"
134-
);
135-
}
127+
if let rusqlite::Error::SqliteFailure(ffi_error, message) = &error
128+
&& ffi_error.code == rusqlite::ErrorCode::DatabaseBusy
129+
{
130+
// Report to sentry.
131+
tracing::error!(
132+
sentry = true,
133+
sqlite_message = message,
134+
"observed database busy error"
135+
);
136136
}
137137
Error::Sqlite(error)
138138
}

crates/matrix-sdk-sqlite/src/event_cache_store.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,7 +1481,7 @@ fn find_event_relations_transaction(
14811481
Ok(related)
14821482
};
14831483

1484-
let related = if let Some(filters) = filters {
1484+
if let Some(filters) = filters {
14851485
let question_marks = repeat_vars(filters.len());
14861486
let query = format!(
14871487
"SELECT events.content, event_chunks.chunk_id, event_chunks.position
@@ -1533,9 +1533,7 @@ fn find_event_relations_transaction(
15331533
let transaction = transaction.query_map(parameters, get_rows)?;
15341534

15351535
collect_results(transaction)
1536-
};
1537-
1538-
related
1536+
}
15391537
}
15401538

15411539
/// Like `deadpool::managed::Object::with_transaction`, but starts the

0 commit comments

Comments
 (0)