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