Skip to content

Commit 541df39

Browse files
committed
Bump to 3.0.0.
1 parent 2b8356f commit 541df39

2 files changed

Lines changed: 2 additions & 10 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "multer"
3-
version = "2.1.0"
3+
version = "3.0.0"
44
description = "An async parser for `multipart/form-data` content-type in Rust."
55
homepage = "https://github.com/rousan/multer-rs"
66
repository = "https://github.com/rousan/multer-rs"

src/field.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use std::borrow::Cow;
21
use std::pin::Pin;
32
use std::sync::Arc;
43
use 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.

0 commit comments

Comments
 (0)