diff options
author | Thomas Hurst <tom@hur.st> | 2018-09-04 22:40:14 +0100 |
---|---|---|
committer | Kartikaya Gupta (kats) <staktrace@users.noreply.github.com> | 2018-09-05 04:05:28 -0400 |
commit | bd195df0a8fc1615729bf01ea572f7e1f3e3b86c (patch) | |
tree | 24af61354c7c7661d2df7974310862dd583f38d7 | |
parent | 8a49f59217f0e2591817f4852dec3e64c91ad3eb (diff) |
Use while let Some(..) over loop { match { .. }}
This looks like it should be a map().collect(), but do the smaller
change first.
clippy:while_let_on_iterator
-rw-r--r-- | src/lib.rs | 7 |
1 files changed, 1 insertions, 6 deletions
@@ -205,12 +205,7 @@ impl<'a> MailHeader<'a> { )); let mut lines = chars.lines(); let mut add_space = false; - loop { - let line = match lines.next() { - Some(v) => v.trim_left(), - None => break, - }; - + while let Some(line) = lines.next().map(str::trim_left) { if add_space { result.push(' '); } |