Skip to content

Commit 8f7c6d2

Browse files
committed
cargo fmt
1 parent a0208b3 commit 8f7c6d2

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

src/concurrent.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
use crate::PoolAllocator;
21
use alloc::{fmt, sync::Arc};
32
use core::{
43
hash::{Hash, Hasher},
54
mem::{forget, MaybeUninit},
65
ops::{Deref, DerefMut},
76
ptr,
87
};
8+
99
use crossbeam_queue::ArrayQueue;
1010

11+
use crate::PoolAllocator;
12+
1113
/// A struct representing an object pool.
1214
///
1315
/// This struct uses an allocator to create and manage objects, and stores them
@@ -73,10 +75,10 @@ impl<P: PoolAllocator<T>, T> Pool<P, T> {
7375
}
7476
}
7577

76-
/// Attempts to get an object from the pool that holds an arc reference to the owning
77-
/// pool. Allocated objects are not as efficient as those allocated by
78-
/// [`Self::get`] method but they are easier to move as they are not limited
79-
/// by allocator lifetime directly.
78+
/// Attempts to get an object from the pool that holds an arc reference to
79+
/// the owning pool. Allocated objects are not as efficient as those
80+
/// allocated by [`Self::get`] method but they are easier to move as
81+
/// they are not limited by allocator lifetime directly.
8082
///
8183
/// If the pool is empty, None is returned.
8284
pub fn try_get_rc(self: Arc<Self>) -> Option<RcGuard<P, T>> {

src/thread_local.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use crate::PoolAllocator;
21
use alloc::{collections::VecDeque, fmt, rc::Rc};
32
use core::{
43
cell::UnsafeCell,
@@ -9,6 +8,8 @@ use core::{
98
ptr,
109
};
1110

11+
use crate::PoolAllocator;
12+
1213
/// A struct representing an object pool for local thread, it cannot be moved
1314
/// between threads.
1415
///
@@ -95,10 +96,10 @@ impl<P: PoolAllocator<T>, T> LocalPool<P, T> {
9596
}
9697
}
9798

98-
/// Attempts to get an object from the pool that holds an rc reference to the owning
99-
/// pool. Allocated objects are not as efficient as those allocated by
100-
/// [`Self::get`] method but they are easier to move as they are not limited
101-
/// by allocator lifetime directly.
99+
/// Attempts to get an object from the pool that holds an rc reference to
100+
/// the owning pool. Allocated objects are not as efficient as those
101+
/// allocated by [`Self::get`] method but they are easier to move as
102+
/// they are not limited by allocator lifetime directly.
102103
///
103104
/// If the pool is empty, None is returned.
104105
pub fn try_get_rc(self: Rc<Self>) -> Option<RcLocalGuard<P, T>> {

0 commit comments

Comments
 (0)