@@ -165,14 +165,10 @@ mod channel_impls;
165
165
#[ cfg( feature = "alloc" ) ]
166
166
mod if_alloc {
167
167
use super :: * ;
168
+ use futures_core:: never:: Never ;
168
169
169
- /// The error type for `Vec` and `VecDequeue` when used as `Sink`s.
170
- /// Values of this type can never be created.
171
- #[ derive( Copy , Clone , Debug ) ]
172
- pub enum VecSinkError { }
173
-
174
- impl < T > Sink < T > for :: alloc:: vec:: Vec < T > {
175
- type SinkError = VecSinkError ;
170
+ impl < T > Sink < T > for alloc:: vec:: Vec < T > {
171
+ type SinkError = Never ;
176
172
177
173
fn poll_ready ( self : Pin < & mut Self > , _: & mut Context < ' _ > ) -> Poll < Result < ( ) , Self :: SinkError > > {
178
174
Poll :: Ready ( Ok ( ( ) ) )
@@ -193,8 +189,8 @@ mod if_alloc {
193
189
}
194
190
}
195
191
196
- impl < T > Sink < T > for :: alloc:: collections:: VecDeque < T > {
197
- type SinkError = VecSinkError ;
192
+ impl < T > Sink < T > for alloc:: collections:: VecDeque < T > {
193
+ type SinkError = Never ;
198
194
199
195
fn poll_ready ( self : Pin < & mut Self > , _: & mut Context < ' _ > ) -> Poll < Result < ( ) , Self :: SinkError > > {
200
196
Poll :: Ready ( Ok ( ( ) ) )
@@ -215,7 +211,7 @@ mod if_alloc {
215
211
}
216
212
}
217
213
218
- impl < S : ?Sized + Sink < Item > + Unpin , Item > Sink < Item > for :: alloc:: boxed:: Box < S > {
214
+ impl < S : ?Sized + Sink < Item > + Unpin , Item > Sink < Item > for alloc:: boxed:: Box < S > {
219
215
type SinkError = S :: SinkError ;
220
216
221
217
fn poll_ready ( mut self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < Result < ( ) , Self :: SinkError > > {
@@ -235,6 +231,3 @@ mod if_alloc {
235
231
}
236
232
}
237
233
}
238
-
239
- #[ cfg( feature = "alloc" ) ]
240
- pub use self :: if_alloc:: * ;
0 commit comments