File tree 2 files changed +10
-4
lines changed
2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,15 @@ impl From<Oid> for CommitId {
84
84
}
85
85
}
86
86
87
+ impl From < gix:: ObjectId > for CommitId {
88
+ fn from ( object_id : gix:: ObjectId ) -> Self {
89
+ #[ allow( clippy:: expect_used) ]
90
+ let oid = Oid :: from_bytes ( object_id. as_bytes ( ) ) . expect ( "`Oid::from_bytes(object_id.as_bytes())` is expected to never fail" ) ;
91
+
92
+ Self :: new ( oid)
93
+ }
94
+ }
95
+
87
96
///
88
97
#[ derive( Debug , Clone ) ]
89
98
pub struct CommitInfo {
Original file line number Diff line number Diff line change @@ -161,10 +161,7 @@ impl<'a> LogWalkerWithoutFilter<'a> {
161
161
let mut count = 0_usize ;
162
162
163
163
while let Some ( Ok ( info) ) = self . walk . next ( ) {
164
- let bytes = info. id . as_bytes ( ) ;
165
- let commit_id: CommitId = Oid :: from_bytes ( bytes) ?. into ( ) ;
166
-
167
- out. push ( commit_id) ;
164
+ out. push ( info. id . into ( ) ) ;
168
165
169
166
count += 1 ;
170
167
You can’t perform that action at this time.
0 commit comments