From c510cd1db7176646a7ae256ccc111762cdd13151 Mon Sep 17 00:00:00 2001 From: Jordan Doyle Date: Sun, 24 May 2020 16:44:15 +0100 Subject: [PATCH] fix: last parameter not matching in parser --- src/parser.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/parser.rs b/src/parser.rs index b8cb88c..cbea93a 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -1,11 +1,9 @@ -use nom::bytes::complete::take_until; - use std::collections::HashMap; use chrono::offset::TimeZone; use chrono::{DateTime, Datelike, Utc}; use nom::{ - bytes::complete::{tag, take}, + bytes::complete::{tag, take, take_till, take_until}, IResult, }; @@ -75,7 +73,7 @@ fn parse_bracketed_param(i: &str) -> IResult<&str, &str> { fn parse_kvs(i: &str) -> IResult<&str, HashMap<&str, &str>> { let (i, kvs) = nom::multi::separated_list0( nom::character::complete::char(' '), - nom::sequence::separated_pair(take_until("="), tag("="), take_until(" ")), + nom::sequence::separated_pair(take_until("="), tag("="), take_till(|c| c == ' ')), )(i)?; let mut map = HashMap::new(); -- libgit2 1.7.2