summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 8c47090..8c56322 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -95,11 +95,9 @@ pub struct MailHeader<'a> {
}
fn is_boundary(line: &str, ix: Option<usize>) -> bool {
- ix.map(|v| {
- line.chars().nth(v).map_or(true, |c| {
- c.is_whitespace() || c == '"' || c == '(' || c == ')' || c == '<' || c == '>'
- })
- }).unwrap_or(true)
+ ix.and_then(|v| line.chars().nth(v))
+ .map(|c| c.is_whitespace() || c == '"' || c == '(' || c == ')' || c == '<' || c == '>')
+ .unwrap_or(true)
}
fn find_from(line: &str, ix_start: usize, key: &str) -> Option<usize> {