History

Remove re-export of git_object::borrowed::Id (#63)

Sebastian Thiel committed 5 years ago

Commit a3f28161 parent fdbe70422 files · +64 −69Browse files

Showing the changes to git-commitgraph/src/file/commit.rs (1 of 22 files). Show all

Unified · Split

git-commitgraph/src/file/commit.rs+5−5
@@ -5,7 +5,7 @@ use crate::{ · 4 unmodified lines
5};5};
6use byteorder::{BigEndian, ByteOrder};6use byteorder::{BigEndian, ByteOrder};
7use git_hash::SIZE_OF_SHA1_DIGEST as SHA1_SIZE;7use git_hash::SIZE_OF_SHA1_DIGEST as SHA1_SIZE;
8use git_object::{borrowed, owned};8use git_object::owned;
9use std::{9use std::{
10 convert::{TryFrom, TryInto},10 convert::{TryFrom, TryInto},
11 fmt::{Debug, Formatter},11 fmt::{Debug, Formatter},
@@ -40,7 +40,7 @@ pub struct Commit<'a> { · 28 unmodified lines
40 generation: u32,40 generation: u32,
41 parent1: ParentEdge,41 parent1: ParentEdge,
42 parent2: ParentEdge,42 parent2: ParentEdge,
43 root_tree_id: borrowed::Id<'a>,43 root_tree_id: git_hash::borrowed::Id<'a>,
44}44}
45 45
46impl<'a> Commit<'a> {46impl<'a> Commit<'a> {
@@ -49,7 +49,7 @@ impl<'a> Commit<'a> { · 2 unmodified lines
49 Commit {49 Commit {
50 file,50 file,
51 pos,51 pos,
52 root_tree_id: borrowed::Id::try_from(&bytes[..SHA1_SIZE]).expect("20 bytes SHA1 to be alright"),52 root_tree_id: git_hash::borrowed::Id::try_from(&bytes[..SHA1_SIZE]).expect("20 bytes SHA1 to be alright"),
53 parent1: ParentEdge::from_raw(BigEndian::read_u32(&bytes[SHA1_SIZE..SHA1_SIZE + 4])),53 parent1: ParentEdge::from_raw(BigEndian::read_u32(&bytes[SHA1_SIZE..SHA1_SIZE + 4])),
54 parent2: ParentEdge::from_raw(BigEndian::read_u32(&bytes[SHA1_SIZE + 4..SHA1_SIZE + 8])),54 parent2: ParentEdge::from_raw(BigEndian::read_u32(&bytes[SHA1_SIZE + 4..SHA1_SIZE + 8])),
55 generation: BigEndian::read_u32(&bytes[SHA1_SIZE + 8..SHA1_SIZE + 12]) >> 2,55 generation: BigEndian::read_u32(&bytes[SHA1_SIZE + 8..SHA1_SIZE + 12]) >> 2,
@@ -84,7 +84,7 @@ impl<'a> Commit<'a> { · 28 unmodified lines
84 }84 }
85 85
86 /// Returns the hash of this commit.86 /// Returns the hash of this commit.
87 pub fn id(&self) -> borrowed::Id<'a> {87 pub fn id(&self) -> git_hash::borrowed::Id<'a> {
88 self.file.id_at(self.pos)88 self.file.id_at(self.pos)
89 }89 }
90 90
@@ -99,7 +99,7 @@ impl<'a> Commit<'a> { · 8 unmodified lines
99 }99 }
100 100
101 /// Return the hash of the tree this commit points to.101 /// Return the hash of the tree this commit points to.
102 pub fn root_tree_id(&self) -> borrowed::Id<'a> {102 pub fn root_tree_id(&self) -> git_hash::borrowed::Id<'a> {
103 self.root_tree_id103 self.root_tree_id
104 }104 }
105}105}