commit | def66371f19aff57099f6f96996878f925060e3c | [log] [tgz] |
---|---|---|
author | David Tolnay <dtolnay@gmail.com> | Mon Oct 24 21:51:32 2016 -0700 |
committer | David Tolnay <dtolnay@gmail.com> | Mon Oct 24 21:51:32 2016 -0700 |
tree | 39ff7329572c49c3e13595f2796798d8bdf325b2 | |
parent | 93413a5280b9a49db9ac6fbb22cd357393230695 [diff] [blame] |
Factor out handling of leading whitespace
diff --git a/src/lib.rs b/src/lib.rs index 043e164..3af64bf 100644 --- a/src/lib.rs +++ b/src/lib.rs
@@ -150,10 +150,7 @@ -> Result<T, String> { match f(input) { IResult::Done(mut rest, t) => { - rest = match space::whitespace(rest) { - IResult::Done(rest, _) => rest, - IResult::Error => rest, - }; + rest = space::skip_whitespace(rest); if rest.is_empty() { Ok(t) } else if rest.len() == input.len() {