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 1
1
use std:: ops:: Range ;
2
2
3
3
use bstr:: { BStr , BString , ByteSlice } ;
4
+ use winnow:: prelude:: * ;
4
5
5
6
use crate :: { Commit , CommitRef , TagRef } ;
6
7
@@ -60,7 +61,9 @@ mod write;
60
61
impl < ' a > CommitRef < ' a > {
61
62
/// Deserialize a commit from the given `data` bytes while avoiding most allocations.
62
63
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)
64
67
}
65
68
}
66
69
Original file line number Diff line number Diff line change
1
+ use winnow:: prelude:: * ;
2
+
1
3
use crate :: TagRef ;
2
4
3
5
mod decode;
@@ -11,7 +13,9 @@ pub mod ref_iter;
11
13
impl < ' a > TagRef < ' a > {
12
14
/// Deserialize a tag from `data`.
13
15
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)
15
19
}
16
20
/// The object this tag points to as `Id`.
17
21
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;
2
2
3
3
use bstr:: BStr ;
4
4
use winnow:: error:: ParserError ;
5
+ use winnow:: prelude:: * ;
5
6
6
7
use crate :: { tree, tree:: EntryRef , TreeRef , TreeRefIter } ;
7
8
@@ -15,7 +16,9 @@ impl<'a> TreeRefIter<'a> {
15
16
impl < ' a > TreeRef < ' a > {
16
17
/// Deserialize a Tree from `data`.
17
18
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)
19
22
}
20
23
21
24
/// 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