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
392
392
return match self . decoder . pull ( ) ? {
393
393
Header :: Tag ( ..) => continue ,
394
394
395
- Header :: Bytes ( Some ( len) ) if len <= self . scratch . len ( ) => {
395
+ Header :: Text ( Some ( len ) ) | Header :: Bytes ( Some ( len) ) if len <= self . scratch . len ( ) => {
396
396
self . decoder . read_exact ( & mut self . scratch [ ..len] ) ?;
397
397
visitor. visit_bytes ( & self . scratch [ ..len] )
398
398
}
@@ -428,6 +428,19 @@ where
428
428
visitor. visit_byte_buf ( buffer)
429
429
}
430
430
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
+
431
444
Header :: Array ( len) => self . recurse ( |me| {
432
445
let access = Access ( me, len) ;
433
446
visitor. visit_seq ( access)
You can’t perform that action at this time.
0 commit comments