]> Untitled Git - bdk/commitdiff
Fix clippy warning
authorSteve Myers <steve@notmandatory.org>
Fri, 24 Sep 2021 01:42:09 +0000 (18:42 -0700)
committerSteve Myers <steve@notmandatory.org>
Fri, 24 Sep 2021 01:57:55 +0000 (18:57 -0700)
src/database/any.rs
src/database/sqlite.rs

index 707d40fc42a34ac128b75639a9b80882fcbd3837..5186452cf253ebdfb4c28d2cf3bbe81ff856e42d 100644 (file)
@@ -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")]
index e396a0a00eb702db8b186d52c193ea4090e1e608..0dbaed44ed6a38b55c634d5b8b335c7847e0ed6d 100644 (file)
@@ -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<u32> = 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,
                 };