@@ -57,7 +57,6 @@ extern crate alloc;
57
57
#[ cfg( feature = "std" ) ]
58
58
extern crate std;
59
59
60
- use alloc:: boxed:: Box ;
61
60
use core:: fmt;
62
61
use core:: panic:: { RefUnwindSafe , UnwindSafe } ;
63
62
use sync:: atomic:: { self , Ordering } ;
@@ -101,10 +100,11 @@ unsafe impl<T: Send> Sync for ConcurrentQueue<T> {}
101
100
impl < T > UnwindSafe for ConcurrentQueue < T > { }
102
101
impl < T > RefUnwindSafe for ConcurrentQueue < T > { }
103
102
103
+ #[ allow( clippy:: large_enum_variant) ]
104
104
enum Inner < T > {
105
105
Single ( Single < T > ) ,
106
- Bounded ( Box < Bounded < T > > ) ,
107
- Unbounded ( Box < Unbounded < T > > ) ,
106
+ Bounded ( Bounded < T > ) ,
107
+ Unbounded ( Unbounded < T > ) ,
108
108
}
109
109
110
110
impl < T > ConcurrentQueue < T > {
@@ -127,7 +127,7 @@ impl<T> ConcurrentQueue<T> {
127
127
if cap == 1 {
128
128
ConcurrentQueue ( Inner :: Single ( Single :: new ( ) ) )
129
129
} else {
130
- ConcurrentQueue ( Inner :: Bounded ( Box :: new ( Bounded :: new ( cap) ) ) )
130
+ ConcurrentQueue ( Inner :: Bounded ( Bounded :: new ( cap) ) )
131
131
}
132
132
}
133
133
@@ -141,7 +141,7 @@ impl<T> ConcurrentQueue<T> {
141
141
/// let q = ConcurrentQueue::<i32>::unbounded();
142
142
/// ```
143
143
pub fn unbounded ( ) -> ConcurrentQueue < T > {
144
- ConcurrentQueue ( Inner :: Unbounded ( Box :: new ( Unbounded :: new ( ) ) ) )
144
+ ConcurrentQueue ( Inner :: Unbounded ( Unbounded :: new ( ) ) )
145
145
}
146
146
147
147
/// Attempts to push an item into the queue.
0 commit comments