File tree Expand file tree Collapse file tree 1 file changed +2
-15
lines changed Expand file tree Collapse file tree 1 file changed +2
-15
lines changed Original file line number Diff line number Diff line change @@ -23,12 +23,11 @@ where
2323{
2424 let body = message. get_body ( ) . into_chunks ( ) ;
2525 buf. reserve ( total_chunk_size ( & body) ) ;
26- let mut new_body = buf. split ( ) ;
2726 body. into_iter ( ) . for_each ( |chunk| {
2827 match chunk {
2928 // 1. Combine ChunkType::Chunk into one body.
3029 ChunkType :: Chunk ( data) => {
31- new_body . extend_from_slice ( & data[ ..data. len ( ) - 2 ] )
30+ buf . extend_from_slice ( & data[ ..data. len ( ) - 2 ] )
3231 }
3332 // 2. If trailer is present,
3433 ChunkType :: Trailers ( trailer) => {
4140 _ => ( ) ,
4241 }
4342 } ) ;
44- message. set_body ( Body :: Raw ( new_body ) ) ;
43+ message. set_body ( Body :: Raw ( buf . split ( ) ) ) ;
4544}
4645
4746// Partial chunked body
@@ -55,15 +54,3 @@ pub fn partial_chunked_to_raw(vec_body: Vec<ChunkType>) -> Option<BytesMut> {
5554
5655 Some ( body)
5756}
58-
59- #[ cfg( test) ]
60- mod tests {
61- use super :: * ;
62- extern crate tests_utils;
63- use tests_utils:: TestMessage ;
64-
65- #[ test]
66- fn test_chunked_to_raw ( ) {
67- let a: Option < TestMessage > ;
68- }
69- }
You can’t perform that action at this time.
0 commit comments