File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -392,7 +392,7 @@ where
392392 return match self . decoder . pull ( ) ? {
393393 Header :: Tag ( ..) => continue ,
394394
395- Header :: Bytes ( Some ( len) ) if len <= self . scratch . len ( ) => {
395+ Header :: Text ( Some ( len ) ) | Header :: Bytes ( Some ( len) ) if len <= self . scratch . len ( ) => {
396396 self . decoder . read_exact ( & mut self . scratch [ ..len] ) ?;
397397 visitor. visit_bytes ( & self . scratch [ ..len] )
398398 }
@@ -428,6 +428,19 @@ where
428428 visitor. visit_byte_buf ( buffer)
429429 }
430430
431+ Header :: Text ( len) => {
432+ let mut buffer = String :: new ( ) ;
433+
434+ let mut segments = self . decoder . text ( len) ;
435+ while let Some ( mut segment) = segments. pull ( ) ? {
436+ while let Some ( chunk) = segment. pull ( self . scratch ) ? {
437+ buffer. push_str ( chunk) ;
438+ }
439+ }
440+
441+ visitor. visit_byte_buf ( buffer. into_bytes ( ) )
442+ }
443+
431444 Header :: Array ( len) => self . recurse ( |me| {
432445 let access = Access ( me, len) ;
433446 visitor. visit_seq ( access)
You can’t perform that action at this time.
0 commit comments