File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 11use std:: ops:: Range ;
22
33use bstr:: { BStr , BString , ByteSlice } ;
4+ use winnow:: prelude:: * ;
45
56use crate :: { Commit , CommitRef , TagRef } ;
67
@@ -60,7 +61,9 @@ mod write;
6061impl < ' a > CommitRef < ' a > {
6162 /// Deserialize a commit from the given `data` bytes while avoiding most allocations.
6263 pub fn from_bytes ( mut data : & ' a [ u8 ] ) -> Result < CommitRef < ' a > , crate :: decode:: Error > {
63- decode:: commit ( & mut data) . map_err ( crate :: decode:: Error :: with_err)
64+ decode:: commit
65+ . parse_next ( & mut data)
66+ . map_err ( crate :: decode:: Error :: with_err)
6467 }
6568}
6669
Original file line number Diff line number Diff line change 1+ use winnow:: prelude:: * ;
2+
13use crate :: TagRef ;
24
35mod decode;
@@ -11,7 +13,9 @@ pub mod ref_iter;
1113impl < ' a > TagRef < ' a > {
1214 /// Deserialize a tag from `data`.
1315 pub fn from_bytes ( mut data : & ' a [ u8 ] ) -> Result < TagRef < ' a > , crate :: decode:: Error > {
14- decode:: git_tag ( & mut data) . map_err ( crate :: decode:: Error :: with_err)
16+ decode:: git_tag
17+ . parse_next ( & mut data)
18+ . map_err ( crate :: decode:: Error :: with_err)
1519 }
1620 /// The object this tag points to as `Id`.
1721 pub fn target ( & self ) -> gix_hash:: ObjectId {
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ use std::convert::TryFrom;
22
33use bstr:: BStr ;
44use winnow:: error:: ParserError ;
5+ use winnow:: prelude:: * ;
56
67use crate :: { tree, tree:: EntryRef , TreeRef , TreeRefIter } ;
78
@@ -15,7 +16,9 @@ impl<'a> TreeRefIter<'a> {
1516impl < ' a > TreeRef < ' a > {
1617 /// Deserialize a Tree from `data`.
1718 pub fn from_bytes ( mut data : & ' a [ u8 ] ) -> Result < TreeRef < ' a > , crate :: decode:: Error > {
18- decode:: tree ( & mut data) . map_err ( crate :: decode:: Error :: with_err)
19+ decode:: tree
20+ . parse_next ( & mut data)
21+ . map_err ( crate :: decode:: Error :: with_err)
1922 }
2023
2124 /// Find an entry named `name` knowing if the entry is a directory or not, using a binary search.
You can’t perform that action at this time.
0 commit comments