File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11[package ]
22name = " multer"
3- version = " 2.1 .0"
3+ version = " 3.0 .0"
44description = " An async parser for `multipart/form-data` content-type in Rust."
55homepage = " https://github.com/rousan/multer-rs"
66repository = " https://github.com/rousan/multer-rs"
Original file line number Diff line number Diff line change 1- use std:: borrow:: Cow ;
21use std:: pin:: Pin ;
32use std:: sync:: Arc ;
43use std:: task:: { Context , Poll } ;
@@ -282,15 +281,8 @@ impl<'r> Field<'r> {
282281 . unwrap_or ( default_encoding) ;
283282
284283 let encoding = Encoding :: for_label ( encoding_name. as_bytes ( ) ) . unwrap_or ( UTF_8 ) ;
285-
286284 let bytes = self . bytes ( ) . await ?;
287-
288- let ( text, ..) = encoding. decode ( & bytes) ;
289-
290- match text {
291- Cow :: Owned ( s) => Ok ( s) ,
292- Cow :: Borrowed ( s) => Ok ( String :: from ( s) ) ,
293- }
285+ Ok ( encoding. decode ( & bytes) . 0 . into_owned ( ) )
294286 }
295287
296288 /// Get the index of this field in order they appeared in the stream.
You can’t perform that action at this time.
0 commit comments