From 919522a456f40ffed8bb084d4f11a34e74197b10 Mon Sep 17 00:00:00 2001 From: Steve Myers Date: Thu, 23 Sep 2021 18:42:09 -0700 Subject: [PATCH] Fix clippy warning --- src/database/any.rs | 1 + src/database/sqlite.rs | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/database/any.rs b/src/database/any.rs index 707d40fc..5186452c 100644 --- a/src/database/any.rs +++ b/src/database/any.rs @@ -320,6 +320,7 @@ impl BatchDatabase for AnyDatabase { match self { AnyDatabase::Memory(db) => match batch { AnyBatch::Memory(batch) => db.commit_batch(batch), + #[cfg(any(feature = "key-value-db", feature = "sqlite"))] _ => unimplemented!("Other batch shouldn't be used with Memory db."), }, #[cfg(feature = "key-value-db")] diff --git a/src/database/sqlite.rs b/src/database/sqlite.rs index e396a0a0..0dbaed44 100644 --- a/src/database/sqlite.rs +++ b/src/database/sqlite.rs @@ -374,8 +374,8 @@ impl SqliteDatabase { None => None, }; - let confirmation_time = match (timestamp, height) { - (Some(timestamp), Some(height)) => Some(ConfirmationTime { timestamp, height }), + let confirmation_time = match (height, timestamp) { + (Some(height), Some(timestamp)) => Some(ConfirmationTime { height, timestamp }), _ => None, }; @@ -408,8 +408,8 @@ impl SqliteDatabase { let height: Option = row.get(5)?; let verified: bool = row.get(6)?; - let confirmation_time = match (timestamp, height) { - (Some(timestamp), Some(height)) => Some(ConfirmationTime { timestamp, height }), + let confirmation_time = match (height, timestamp) { + (Some(height), Some(timestamp)) => Some(ConfirmationTime { height, timestamp }), _ => None, }; @@ -451,8 +451,8 @@ impl SqliteDatabase { None => None, }; - let confirmation_time = match (timestamp, height) { - (Some(timestamp), Some(height)) => Some(ConfirmationTime { timestamp, height }), + let confirmation_time = match (height, timestamp) { + (Some(height), Some(timestamp)) => Some(ConfirmationTime { height, timestamp }), _ => None, };