Skip to content

Commit

Permalink
Upgrade bitflags to from 1.2 to 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
saschanaz committed Oct 30, 2023
1 parent 55a5a4d commit 680f60b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ with-fuzzer-no-link = ["lmdb", "lmdb-rkv/with-fuzzer-no-link"]
[dependencies]
arrayref = "0.3"
bincode = "1.0"
bitflags = "1.2"
bitflags = {version = "2.4.1", features = ["serde"]}
byteorder = "1"
id-arena = "2.2"
lazy_static = "1.1"
Expand Down
3 changes: 2 additions & 1 deletion src/backend/impl_safe/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,8 @@ impl<'e> BackendEnvironment<'e> for EnvironmentImpl {
// TOOD: don't reallocate `name`.
let key = name.map(String::from);
let mut dbs = self.dbs.write().map_err(|_| ErrorImpl::EnvPoisonError)?;
if dbs.name_map.keys().filter_map(|k| k.as_ref()).count() >= self.max_dbs && name.is_some() {
if dbs.name_map.keys().filter_map(|k| k.as_ref()).count() >= self.max_dbs && name.is_some()
{
return Err(ErrorImpl::DbsFull);
}
let parts = EnvironmentDbsRefMut::from(dbs.deref_mut());
Expand Down
6 changes: 3 additions & 3 deletions src/backend/impl_safe/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use crate::backend::{
};

bitflags! {
#[derive(Default, Serialize, Deserialize)]
#[derive(Default, Serialize, Deserialize, PartialEq, Eq, Debug, Clone, Copy)]
pub struct EnvironmentFlagsImpl: u32 {
const NIL = 0b0000_0000;
}
Expand Down Expand Up @@ -54,7 +54,7 @@ impl Into<EnvironmentFlagsImpl> for EnvironmentFlags {
}

bitflags! {
#[derive(Default, Serialize, Deserialize)]
#[derive(Default, Serialize, Deserialize, PartialEq, Eq, Debug, Clone, Copy)]
pub struct DatabaseFlagsImpl: u32 {
const NIL = 0b0000_0000;
#[cfg(feature = "db-dup-sort")]
Expand Down Expand Up @@ -93,7 +93,7 @@ impl Into<DatabaseFlagsImpl> for DatabaseFlags {
}

bitflags! {
#[derive(Default, Serialize, Deserialize)]
#[derive(Default, Serialize, Deserialize, PartialEq, Eq, Debug, Clone, Copy)]
pub struct WriteFlagsImpl: u32 {
const NIL = 0b0000_0000;
}
Expand Down

0 comments on commit 680f60b

Please sign in to comment.