mirror of
https://gitee.com/openharmony/third_party_rust_nom
synced 2024-11-23 07:29:54 +00:00
Fix lifetime error with rustc f1bb6c2f4
This commit is contained in:
parent
a62148a917
commit
37dfdf1122
@ -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()])
|
||||
|
Loading…
Reference in New Issue
Block a user