mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 16:57:49 +03:00
add changesetid/manifestid/entryid structure
Summary: add wrapper for nodehash Reviewed By: lukaspiatkowski Differential Revision: D6694937 fbshipit-source-id: c1c79fd8fb37d40211b84341105af1d6fa155708
This commit is contained in:
parent
70244ff1d6
commit
7a3ef80526
@ -135,3 +135,45 @@ impl Arbitrary for NodeHash {
|
||||
single_shrinker(NULL_HASH)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
|
||||
#[derive(HeapSizeOf)]
|
||||
pub struct ChangesetId(NodeHash);
|
||||
|
||||
impl ChangesetId {
|
||||
pub fn new(hash: NodeHash) -> Self {
|
||||
ChangesetId(hash)
|
||||
}
|
||||
|
||||
pub fn into_nodehash(self) -> NodeHash {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
|
||||
#[derive(HeapSizeOf)]
|
||||
pub struct ManifestId(NodeHash);
|
||||
|
||||
impl ManifestId {
|
||||
pub fn new(hash: NodeHash) -> Self {
|
||||
ManifestId(hash)
|
||||
}
|
||||
|
||||
pub fn into_nodehash(self) -> NodeHash {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
|
||||
#[derive(HeapSizeOf)]
|
||||
pub struct EntryId(NodeHash);
|
||||
|
||||
impl EntryId {
|
||||
pub fn new(hash: NodeHash) -> Self {
|
||||
EntryId(hash)
|
||||
}
|
||||
|
||||
pub fn into_nodehash(self) -> NodeHash {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user