Factor out handling of leading whitespace
diff --git a/src/helper.rs b/src/helper.rs
index 5606fd0..bf19971 100644
--- a/src/helper.rs
+++ b/src/helper.rs
@@ -1,5 +1,5 @@
use nom::IResult;
-use space::{whitespace, word_break};
+use space::{skip_whitespace, word_break};
macro_rules! punct {
($i:expr, $punct:expr) => {
@@ -8,10 +8,7 @@
}
pub fn punct<'a>(input: &'a str, token: &'static str) -> IResult<&'a str, &'a str> {
- let input = match whitespace(input) {
- IResult::Done(rest, _) => rest,
- IResult::Error => input,
- };
+ let input = skip_whitespace(input);
if input.starts_with(token) {
IResult::Done(&input[token.len()..], token)
} else {