Fix lifetime error with rustc f1bb6c2f4

This commit is contained in:
Geoffroy Couprie 2015-02-17 17:54:39 +01:00
parent a62148a917
commit 37dfdf1122

View File

@ -34,7 +34,7 @@ macro_rules! tag(
)
);
pub fn tag_cl<'a,'b>(rec:&'a[u8]) -> Box<Fn(&'b[u8]) -> IResult<&'b[u8], &'b[u8]>> {
pub fn tag_cl<'a,'b>(rec:&'a[u8]) -> Box<Fn(&'b[u8]) -> IResult<&'b[u8], &'b[u8]> + 'a> {
Box::new(move |i: &'b[u8]| -> IResult<&'b[u8], &'b[u8]> {
if i.len() >= rec.len() && i.slice(0, rec.len()) == rec {
Done(&i[rec.len()..], &i[0..rec.len()])