Skip to content

Commit

Permalink
make clippy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
wtdcode committed Oct 26, 2024
1 parent ab17194 commit fa3fe3b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
20 changes: 9 additions & 11 deletions crates/storage/libmdbx-rs/src/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -432,18 +432,16 @@ impl Info {
let mode = self.0.mi_mode;
if (mode & ffi::MDBX_RDONLY) != 0 {
Mode::ReadOnly
} else if (mode & ffi::MDBX_SYNC_DURABLE) != 0 {
Mode::ReadWrite { sync_mode: SyncMode::Durable }
} else if (mode & ffi::MDBX_UTTERLY_NOSYNC) != 0 {
Mode::ReadWrite { sync_mode: SyncMode::UtterlyNoSync }
} else if (mode & ffi::MDBX_NOMETASYNC) != 0 {
Mode::ReadWrite { sync_mode: SyncMode::NoMetaSync }
} else if (mode & ffi::MDBX_SAFE_NOSYNC) != 0 {
Mode::ReadWrite { sync_mode: SyncMode::SafeNoSync }
} else {
if (mode & ffi::MDBX_SYNC_DURABLE) != 0 {
Mode::ReadWrite { sync_mode: SyncMode::Durable }
} else if (mode & ffi::MDBX_UTTERLY_NOSYNC) != 0 {
Mode::ReadWrite { sync_mode: SyncMode::UtterlyNoSync }
} else if (mode & ffi::MDBX_NOMETASYNC) != 0 {
Mode::ReadWrite { sync_mode: SyncMode::NoMetaSync }
} else if (mode & ffi::MDBX_SAFE_NOSYNC) != 0 {
Mode::ReadWrite { sync_mode: SyncMode::SafeNoSync }
} else {
Mode::ReadWrite { sync_mode: SyncMode::Durable }
}
Mode::ReadWrite { sync_mode: SyncMode::Durable }
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/storage/libmdbx-rs/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::{
txn_manager::{TxnManagerMessage, TxnPtr},
Cursor, Error, Stat, TableObject,
};
use ffi::{mdbx_txn_renew, MDBX_txn_flags_t, MDBX_TXN_RDONLY, MDBX_TXN_READWRITE};
use ffi::{MDBX_txn_flags_t, MDBX_TXN_RDONLY, MDBX_TXN_READWRITE};
use indexmap::IndexSet;
use parking_lot::{Mutex, MutexGuard};
use std::{
Expand Down

0 comments on commit fa3fe3b

Please sign in to comment.