Collapse UriHeaders
authorRichard Whitehouse <github@richardwhiuk.com>
Sun, 29 Oct 2017 11:58:32 +0000 (11:58 +0000)
committerRichard Whitehouse <github@richardwhiuk.com>
Sun, 29 Oct 2017 11:58:32 +0000 (11:58 +0000)
src/parser.rs
src/types.rs

index 6f395e294ac6a2e3e0e8e936dfd9ac7c88c4e059..3f8b08ec76ea4a8639c713dce3c530a65d9e4326 100644 (file)
@@ -266,15 +266,14 @@ named!(hvalue<&[u8], Vec<u8>>, many1!(alt!(
 
 named!(uri_header<&[u8], UriHeader>, separated_pair!(
     hname,
-    tag!("="),
+    tag!(b"="),
     hvalue));
 
 named!(uri_headers<&[u8], UriHeaders>, preceded!(
     char!('?'),
-    tuple!(
-        uri_header,
-        many0!(
-            preceded!(char!('&'), uri_header)))));
+    separated_nonempty_list!(
+       tag!(b"&"),
+        uri_header)));
 
 type _SipUri = (Option<UserInfo>, HostPort, Vec<UriParameter>, Option<UriHeaders>);
 
index 4a443526bb2e849fa8da583f9f7a8107477fc66a..467ca98fd45c0bb6dda10bc2b4269e4fc01171ac 100644 (file)
@@ -46,7 +46,7 @@ pub type Scheme = (u8, Vec<u8>);
 
 pub type UriHeader = (Vec<u8>, Vec<u8>);
 
-pub type UriHeaders = (UriHeader, Vec<UriHeader>);
+pub type UriHeaders = Vec<UriHeader>;
 
 #[derive(Debug)]
 pub enum Transport {