Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn header_field<'a, T>(input: T) -> IResult<T, (&'a str, &'a str), u32>
- where
- T: 'a,
- T: Slice<Range<usize>> + Slice<RangeFrom<usize>> + Slice<RangeTo<usize>>,
- T: Clone + Offset,
- T: AsBytes + InputIter + AtEof,
- T: PartialEq,
- T: FindSubstring<&'a [u8]>,
- <T as InputIter>::Item: AsChar,
- T: InputTakeAtPosition,
- <T as InputTakeAtPosition>::Item: AsChar
- {
- do_parse!(input,
- key: map_res!(
- map!(take_until_and_consume!(b":" as &[u8]),
- |a| a.as_bytes()),
- std::str::from_utf8) >>
- val: map_res!(
- map!(take_until_and_consume!(b"\r" as &[u8]),
- |a| a.as_bytes()),
- std::str::from_utf8) >>
- (key.trim(), val)
- )
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement