diff options
author | Kartikaya Gupta <kats@trevize.staktrace.com> | 2019-05-23 21:55:20 -0400 |
---|---|---|
committer | Kartikaya Gupta <kats@trevize.staktrace.com> | 2019-05-23 21:55:20 -0400 |
commit | ee59e811681dedac8a44b3510d29888beb557c5c (patch) | |
tree | e8f0db97f69e778bcb11f1371ff78fb03862527f | |
parent | 8875b3df5579c6ac4a39c1fb7cb59ce525a0d5a6 (diff) |
Stop using deprecated trim_left/right
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | src/lib.rs | 6 |
2 files changed, 4 insertions, 4 deletions
@@ -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" @@ -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(' '); } |