Skip to content

Commit

Permalink
Bump to 3.0.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioBenitez committed Dec 14, 2023
1 parent 2b8356f commit 541df39
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "multer"
version = "2.1.0"
version = "3.0.0"
description = "An async parser for `multipart/form-data` content-type in Rust."
homepage = "https://github.com/rousan/multer-rs"
repository = "https://github.com/rousan/multer-rs"
Expand Down
10 changes: 1 addition & 9 deletions src/field.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use std::borrow::Cow;
use std::pin::Pin;
use std::sync::Arc;
use std::task::{Context, Poll};
Expand Down Expand Up @@ -282,15 +281,8 @@ impl<'r> Field<'r> {
.unwrap_or(default_encoding);

let encoding = Encoding::for_label(encoding_name.as_bytes()).unwrap_or(UTF_8);

let bytes = self.bytes().await?;

let (text, ..) = encoding.decode(&bytes);

match text {
Cow::Owned(s) => Ok(s),
Cow::Borrowed(s) => Ok(String::from(s)),
}
Ok(encoding.decode(&bytes).0.into_owned())
}

/// Get the index of this field in order they appeared in the stream.
Expand Down

0 comments on commit 541df39

Please sign in to comment.