summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKartikaya Gupta <kats@trevize.staktrace.com>2019-05-23 21:55:20 -0400
committerKartikaya Gupta <kats@trevize.staktrace.com>2019-05-23 21:55:20 -0400
commitee59e811681dedac8a44b3510d29888beb557c5c (patch)
treee8f0db97f69e778bcb11f1371ff78fb03862527f
parent8875b3df5579c6ac4a39c1fb7cb59ce525a0d5a6 (diff)
downloadmailparse-ee59e811681dedac8a44b3510d29888beb557c5c.tar.gz
mailparse-ee59e811681dedac8a44b3510d29888beb557c5c.tar.xz
Stop using deprecated trim_left/right
-rw-r--r--Cargo.toml2
-rw-r--r--src/lib.rs6
2 files changed, 4 insertions, 4 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 667e3da..c78b484 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -18,5 +18,5 @@ maintenance = { status = "passively-maintained" }
[dependencies]
base64 = "0.10.0"
-quoted_printable = "0.4.0"
+quoted_printable = "0.4.1"
charset = "0.1.1"
diff --git a/src/lib.rs b/src/lib.rs
index b5dbfbc..53bc25d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -154,11 +154,11 @@ impl<'a> MailHeader<'a> {
let decoded = match transfer_coding {
"B" | "b" => base64::decode(input.as_bytes()).ok()?,
"Q" | "q" => {
- // The quoted_printable module does a trim_right on the input, so if
+ // The quoted_printable module does a trim_end on the input, so if
// that affects the output we should save and restore the trailing
// whitespace
let to_decode = input.replace("_", " ");
- let trimmed = to_decode.trim_right();
+ let trimmed = to_decode.trim_end();
let mut d =
quoted_printable::decode(&trimmed, quoted_printable::ParseMode::Robust);
if d.is_ok() && to_decode.len() != trimmed.len() {
@@ -193,7 +193,7 @@ impl<'a> MailHeader<'a> {
let chars = decode_latin1(self.value);
let mut lines = chars.lines();
let mut add_space = false;
- while let Some(line) = lines.next().map(str::trim_left) {
+ while let Some(line) = lines.next().map(str::trim_start) {
if add_space {
result.push(' ');
}