Fix clippy warning

This commit is contained in:
Steve Myers 2021-09-23 18:42:09 -07:00
parent 678607e673
commit 919522a456
No known key found for this signature in database
GPG Key ID: 8105A46B22C2D051
2 changed files with 7 additions and 6 deletions

View 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")]

View 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,
};