Skip to content

Instantly share code, notes, and snippets.

@Keruspe
Created February 3, 2016 14:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Keruspe/06e5d737db0001f14508 to your computer and use it in GitHub Desktop.
Save Keruspe/06e5d737db0001f14508 to your computer and use it in GitHub Desktop.
stdin
diff --git a/src/parser.rs b/src/parser.rs
index 3945963..a0b9b53 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -334,13 +334,7 @@ fn parse_ustar00<'a, 'b>(i: &'a [u8], flag: &'b TypeFlag) -> IResult<&'a [u8], E
}
fn parse_ustar<'a, 'b>(i: &'a [u8], flag: &'b TypeFlag) -> IResult<&'a [u8], ExtraHeader<'a>> {
- chain!(i,
- tag!("ustar\0") ~
- ustar: apply!(parse_ustar00, flag),
- ||{
- ustar
- }
- )
+ map!(i, pair!(tag!("ustar\0"), apply!(parse_ustar00, flag)), |(_, ustar)| ustar);
}
/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment