File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed
Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,9 @@ impl<T: Source + Hash + PartialEq + Eq + 'static> Source for CachedSource<T> {
8282 }
8383
8484 fn buffer ( & self ) -> Cow < [ u8 ] > {
85- self . inner . buffer ( )
85+ let mut buffer = vec ! [ ] ;
86+ self . to_writer ( & mut buffer) . unwrap ( ) ;
87+ Cow :: Owned ( buffer)
8688 }
8789
8890 fn size ( & self ) -> usize {
Original file line number Diff line number Diff line change @@ -141,12 +141,9 @@ impl Source for ConcatSource {
141141 if children. len ( ) == 1 {
142142 children[ 0 ] . buffer ( )
143143 } else {
144- let all = children
145- . iter ( )
146- . map ( |child| child. buffer ( ) )
147- . collect :: < Vec < _ > > ( )
148- . concat ( ) ;
149- Cow :: Owned ( all)
144+ let mut buffer = vec ! [ ] ;
145+ self . to_writer ( & mut buffer) . unwrap ( ) ;
146+ Cow :: Owned ( buffer)
150147 }
151148 }
152149
You can’t perform that action at this time.
0 commit comments