Skip to content

Commit

Permalink
include the headers into the Captures struct
Browse files Browse the repository at this point in the history
  • Loading branch information
jcreekmore committed Feb 26, 2023
1 parent 55a17c3 commit 87782c4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/parser.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
pub struct Captures<'a> {
pub begin: &'a [u8],
pub headers: &'a [u8],
pub data: &'a [u8],
pub end: &'a [u8],
}
Expand Down Expand Up @@ -71,10 +72,15 @@ fn parser_inner(input: &[u8]) -> Option<(&[u8], Captures<'_>)> {

let (input, begin) = parse_begin(input)?;
let (input, payload) = parse_payload(input)?;
let (_headers, data) = extract_headers_and_data(payload);
let (headers, data) = extract_headers_and_data(payload);
let (remaining, end) = parse_end(input)?;

let captures = Captures { begin, data, end };
let captures = Captures {
begin,
headers,
data,
end,
};
Some((remaining, captures))
}

Expand Down

0 comments on commit 87782c4

Please sign in to comment.