Showing the changes to git-commitgraph/tests/commitgraph.rs (1 of 6 files). Show all
Unified · Split
| @@ -87,20 +87,20 @@ pub struct RefInfo { · 86 unmodified lines | ||
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | impl RefInfo { |
| 90 | − pub fn id(&self) -> git_hash::borrowed::Id { | |
| 91 | − self.id.to_borrowed() | |
| 90 | + pub fn id(&self) -> &git_hash::oid { | |
| 91 | + &self.id | |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | pub fn pos(&self) -> GraphPosition { |
| 95 | 95 | self.pos |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | − pub fn parent_ids(&self) -> impl IntoIterator<Item = git_hash::borrowed::Id> { | |
| 99 | − self.parent_ids.iter().map(|x| x.to_borrowed()) | |
| 98 | + pub fn parent_ids(&self) -> impl IntoIterator<Item = &git_hash::oid> { | |
| 99 | + self.parent_ids.iter().map(|x| x.as_ref()) | |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | − pub fn root_tree_id(&self) -> git_hash::borrowed::Id { | |
| 103 | − self.root_tree_id.to_borrowed() | |
| 102 | + pub fn root_tree_id(&self) -> &git_hash::oid { | |
| 103 | + &self.root_tree_id | |
| 104 | 104 | } |
| 105 | 105 | } |
| 106 | 106 | |
| @@ -135,9 +135,9 @@ pub fn inspect_refs(repo_dir: impl AsRef<Path>, refs: &[&'static str]) -> HashMa · 28 unmodified lines | ||
| 135 | 135 | .collect(); |
| 136 | 136 | infos.sort_by_key(|x| x.1); |
| 137 | 137 | |
| 138 | − let get_pos = |id: git_hash::borrowed::Id| -> GraphPosition { | |
| 138 | + let get_pos = |id: &git_hash::oid| -> GraphPosition { | |
| 139 | 139 | let pos: u32 = infos |
| 140 | − .binary_search_by_key(&id, |x| x.1.to_borrowed()) | |
| 140 | + .binary_search_by_key(&id, |x| &x.1) | |
| 141 | 141 | .expect("sorted_ids to contain id") |
| 142 | 142 | .try_into() |
| 143 | 143 | .expect("graph position to fit in u32"); |
| @@ -154,7 +154,7 @@ pub fn inspect_refs(repo_dir: impl AsRef<Path>, refs: &[&'static str]) -> HashMa · 10 unmodified lines | ||
| 154 | 154 | id, |
| 155 | 155 | parent_ids, |
| 156 | 156 | root_tree_id, |
| 157 | − pos: get_pos(id.to_borrowed()), | |
| 157 | + pos: get_pos(&id), | |
| 158 | 158 | }, |
| 159 | 159 | ) |
| 160 | 160 | }) |