@@ -81,7 +81,7 @@ impl<S: Scope, C: Container + 'static> OwnedStream<S, C> {
81
81
}
82
82
83
83
/// Allows the assertion of a container type, for the benefit of type inference.
84
- pub fn container < D : Container > ( self ) -> < Self as AsStream < S , D > > :: Stream where Self : AsStream < S , D > { self . as_stream ( ) }
84
+ pub fn container < D : Container > ( self ) -> OwnedStream < S , C > where Self : AsStream < S , D > { self . as_stream ( ) }
85
85
}
86
86
87
87
/// A stream batching data in vectors.
@@ -136,24 +136,20 @@ impl<S: Scope, C: Container> StreamCore<S, C> {
136
136
pub fn scope ( & self ) -> S { self . scope . clone ( ) }
137
137
138
138
/// Allows the assertion of a container type, for the benefit of type inference.
139
- pub fn container < D : Container > ( self ) -> < Self as AsStream < S , D > > :: Stream where Self : AsStream < S , D > { self . as_stream ( ) }
139
+ pub fn container < D : Container > ( self ) -> StreamCore < S , C > where Self : AsStream < S , D > { self . as_stream ( ) }
140
140
}
141
141
142
142
/// A type that can be translated to a [StreamCore].
143
143
pub trait AsStream < S : Scope , C > {
144
- /// The type of the stream.
145
- type Stream ;
146
144
/// Translate `self` to a stream.
147
- fn as_stream ( self ) -> Self :: Stream ;
145
+ fn as_stream ( self ) -> Self ;
148
146
}
149
147
150
148
impl < S : Scope , C > AsStream < S , C > for StreamCore < S , C > {
151
- type Stream = StreamCore < S , C > ;
152
149
fn as_stream ( self ) -> Self { self }
153
150
}
154
151
155
152
impl < G : Scope , C > AsStream < G , C > for OwnedStream < G , C > {
156
- type Stream = OwnedStream < G , C > ;
157
153
fn as_stream ( self ) -> Self { self }
158
154
}
159
155
0 commit comments