@@ -9,7 +9,7 @@ use rustc_hash::FxHasher;
99use crate :: {
1010 helpers:: {
1111 stream_and_get_source_and_map, stream_chunks_of_raw_source,
12- stream_chunks_of_source_map, Chunks , GeneratedInfo , StreamChunks ,
12+ stream_chunks_of_source_map, Stream , GeneratedInfo , ToStream ,
1313 } ,
1414 object_pool:: ObjectPool ,
1515 source:: { IndexSourceMap , SourceValue } ,
@@ -182,26 +182,26 @@ impl Source for CachedSource {
182182 }
183183}
184184
185- struct CachedSourceChunks < ' source > {
186- chunks : Box < dyn Chunks + ' source > ,
185+ struct CachedSourceStream < ' source > {
186+ stream : Box < dyn Stream + ' source > ,
187187 cache : Arc < CachedData > ,
188188 source : Cow < ' source , str > ,
189189}
190190
191- impl < ' a > CachedSourceChunks < ' a > {
191+ impl < ' a > CachedSourceStream < ' a > {
192192 fn new ( cache_source : & ' a CachedSource ) -> Self {
193193 let source = cache_source. source ( ) . into_string_lossy ( ) ;
194194
195195 Self {
196- chunks : cache_source. inner . stream_chunks ( ) ,
196+ stream : cache_source. inner . to_stream ( ) ,
197197 cache : cache_source. cache . clone ( ) ,
198198 source,
199199 }
200200 }
201201}
202202
203- impl Chunks for CachedSourceChunks < ' _ > {
204- fn stream < ' a > (
203+ impl Stream for CachedSourceStream < ' _ > {
204+ fn chunks < ' a > (
205205 & ' a self ,
206206 object_pool : & ' a ObjectPool ,
207207 options : & MapOptions ,
@@ -240,7 +240,7 @@ impl Chunks for CachedSourceChunks<'_> {
240240 let ( generated_info, map) = stream_and_get_source_and_map (
241241 options,
242242 object_pool,
243- self . chunks . as_ref ( ) ,
243+ self . stream . as_ref ( ) ,
244244 on_chunk,
245245 on_source,
246246 on_name,
@@ -252,9 +252,9 @@ impl Chunks for CachedSourceChunks<'_> {
252252 }
253253}
254254
255- impl StreamChunks for CachedSource {
256- fn stream_chunks < ' a > ( & ' a self ) -> Box < dyn Chunks + ' a > {
257- Box :: new ( CachedSourceChunks :: new ( self ) )
255+ impl ToStream for CachedSource {
256+ fn to_stream < ' a > ( & ' a self ) -> Box < dyn Stream + ' a > {
257+ Box :: new ( CachedSourceStream :: new ( self ) )
258258 }
259259}
260260
@@ -409,8 +409,8 @@ mod tests {
409409 let mut on_name_count = 0 ;
410410 let generated_info = {
411411 let object_pool = ObjectPool :: default ( ) ;
412- let chunks = source. stream_chunks ( ) ;
413- chunks . stream (
412+ let stream = source. to_stream ( ) ;
413+ stream. chunks (
414414 & object_pool,
415415 & map_options,
416416 & mut |_chunk, _mapping| {
@@ -426,7 +426,7 @@ mod tests {
426426 } ;
427427
428428 let cached_source = CachedSource :: new ( source) ;
429- cached_source. stream_chunks ( ) . stream (
429+ cached_source. to_stream ( ) . chunks (
430430 & ObjectPool :: default ( ) ,
431431 & map_options,
432432 & mut |_chunk, _mapping| { } ,
@@ -437,7 +437,7 @@ mod tests {
437437 let mut cached_on_chunk_count = 0 ;
438438 let mut cached_on_source_count = 0 ;
439439 let mut cached_on_name_count = 0 ;
440- let cached_generated_info = cached_source. stream_chunks ( ) . stream (
440+ let cached_generated_info = cached_source. to_stream ( ) . chunks (
441441 & ObjectPool :: default ( ) ,
442442 & map_options,
443443 & mut |_chunk, _mapping| {
0 commit comments