History

[repository #165] refactor

Sebastian Thiel committed 5 years ago

Commit 1547d0b1 parent aa0511f13 files · +211 −208Browse files

Showing the changes to git-commitgraph/src (1 of 13 files). Show all

Unified · Split

git-commitgraph/src/file/access.rs+2−2
@@ -35,7 +35,7 @@ impl File { · 34 unmodified lines
35 35
36 /// Returns 20 bytes sha1 at the given index in our list of (sorted) sha1 hashes.36 /// Returns 20 bytes sha1 at the given index in our list of (sorted) sha1 hashes.
37 /// The position ranges from 0 to self.num_commits()37 /// The position ranges from 0 to self.num_commits()
38 // copied from git-odb/src/pack/index/access.rs38 // copied from git-odb/src/pack/index/ext
39 pub fn id_at(&self, pos: file::Position) -> &git_hash::oid {39 pub fn id_at(&self, pos: file::Position) -> &git_hash::oid {
40 assert!(40 assert!(
41 pos.0 < self.num_commits(),41 pos.0 < self.num_commits(),
@@ -71,7 +71,7 @@ impl File { · 29 unmodified lines
71 }71 }
72 72
73 /// Translate the given object hash to its position within this file, if present.73 /// Translate the given object hash to its position within this file, if present.
74 // copied from git-odb/src/pack/index/access.rs74 // copied from git-odb/src/pack/index/ext
75 pub fn lookup(&self, id: impl AsRef<git_hash::oid>) -> Option<file::Position> {75 pub fn lookup(&self, id: impl AsRef<git_hash::oid>) -> Option<file::Position> {
76 let id = id.as_ref();76 let id = id.as_ref();
77 let first_byte = usize::from(id.first_byte());77 let first_byte = usize::from(id.first_byte());