Skip to content

Commit

Permalink
style(imports): group imports
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewsonin committed May 21, 2024
1 parent 8ac228e commit e482cf8
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 47 deletions.
22 changes: 10 additions & 12 deletions src/collections/blazemap.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
pub use crate::collections::blazemap::{
entries::{Entry, OccupiedEntry, VacantEntry},
iters::{Drain, IntoIter, IntoKeys, IntoValues, Iter, IterMut, Keys, Values, ValuesMut},
};
use crate::{
collections::blazemap::entries::VacantEntryInner,
traits::{
BlazeMapId, BlazeMapIdStatic, CapacityInfoProvider, KeyByOffsetProvider, TypeInfoContainer,
},
};
use std::{
borrow::Borrow,
fmt::{Debug, Formatter},
marker::PhantomData,
};

#[cfg(feature = "serde")]
use {
crate::prelude::BlazeMapIdWrapper,
Expand All @@ -14,17 +23,6 @@ use {
},
};

pub use crate::collections::blazemap::{
entries::{Entry, OccupiedEntry, VacantEntry},
iters::{Drain, IntoIter, IntoKeys, IntoValues, Iter, IterMut, Keys, Values, ValuesMut},
};
use crate::{
collections::blazemap::entries::VacantEntryInner,
traits::{
BlazeMapId, BlazeMapIdStatic, CapacityInfoProvider, KeyByOffsetProvider, TypeInfoContainer,
},
};

mod entries;
mod iters;

Expand Down
11 changes: 5 additions & 6 deletions src/collections/blazemap/iters.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
use crate::{
collections::blazemap::BlazeMap,
prelude::{BlazeMapId, BlazeMapIdStatic},
traits::{KeyByOffsetProvider, TypeInfoContainer},
};
use std::{
borrow::Borrow,
fmt::{Debug, Formatter},
marker::PhantomData,
panic::{RefUnwindSafe, UnwindSafe},
};

use crate::{
collections::blazemap::BlazeMap,
prelude::{BlazeMapId, BlazeMapIdStatic},
traits::{KeyByOffsetProvider, TypeInfoContainer},
};

/// An iterator over the entries of a [`BlazeMap`].
///
/// This `struct` is created by the [`iter`] method on [`BlazeMap`]. See its
Expand Down
10 changes: 5 additions & 5 deletions src/loom.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use std::{cmp::Ordering, marker::PhantomData};

use crate::prelude::AllInstancesIter;
use crate::{
prelude::AllInstancesIter,
traits::{BlazeMapId, TypeInfoContainer},
};
#[cfg(feature = "serde")]
use serde::{Serialize, Serializer};

use crate::traits::{BlazeMapId, TypeInfoContainer};
use std::{cmp::Ordering, marker::PhantomData};

/// Provides `PartialOrd`, `Ord` and `Serialize` traits, which are derived as
/// for an original type, for [`BlazeMapId`]s in the
Expand Down
16 changes: 7 additions & 9 deletions src/type_info_containers/key_wrapper.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
use crate::{
prelude::BlazeMapId,
sync::RwLock,
traits::{CapacityInfoProvider, KeyByOffsetProvider, TypeInfoContainer, WrapKey},
};
#[cfg(not(feature = "loom"))]
use once_cell::sync::Lazy;
use std::{
borrow::Borrow,
collections::{hash_map::Entry, HashMap},
hash::Hash,
ops::Deref,
};

#[cfg(not(feature = "loom"))]
use once_cell::sync::Lazy;

use crate::{
prelude::BlazeMapId,
sync::RwLock,
traits::{CapacityInfoProvider, KeyByOffsetProvider, TypeInfoContainer, WrapKey},
};

/// Global, statically initialized container with correspondence mapping
/// between blazemap offset wrappers and original keys.
#[cfg(not(feature = "loom"))]
Expand Down
21 changes: 9 additions & 12 deletions src/type_info_containers/key_wrapper_bounded.rs
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
#[cfg(feature = "loom")]
use crate::sync::RwLockReadGuard;
use crate::{
prelude::BlazeMapId,
sync::{AtomicUsize, Ordering, RwLock},
traits::{CapacityInfoProvider, KeyByOffsetProvider, TypeInfoContainer, WrapKey},
};
use std::{
borrow::Borrow,
collections::{hash_map::Entry, HashMap},
hash::Hash,
ops::Deref,
};

use std::{borrow::Borrow, ops::Deref};
#[cfg(not(feature = "loom"))]
use std::{
cell::UnsafeCell,
mem::{needs_drop, MaybeUninit},
};

use crate::sync::{AtomicUsize, Ordering, RwLock};

use crate::{
prelude::BlazeMapId,
traits::{CapacityInfoProvider, KeyByOffsetProvider, TypeInfoContainer, WrapKey},
};

#[cfg(feature = "loom")]
use crate::sync::RwLockReadGuard;

/// Global, statically initialized container with correspondence mapping
/// between blazemap index wrappers and original keys.
///
Expand Down
7 changes: 4 additions & 3 deletions src/type_info_containers/plain_id.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use crate::sync::{AtomicUsize, Ordering};
use crate::{
sync::{AtomicUsize, Ordering},
traits::{CapacityInfoProvider, KeyByOffsetProvider, TypeInfoContainer},
};
use std::{borrow::Borrow, ops::Deref};

use crate::traits::{CapacityInfoProvider, KeyByOffsetProvider, TypeInfoContainer};

/// Global, statically initialized offset generator.
#[doc(hidden)]
#[derive(Debug)]
Expand Down

0 comments on commit e482cf8

Please sign in to comment.