Convert into the algorithm-tagged core type for Git interop.
(&self)
| 103 | |
| 104 | /// Convert into the algorithm-tagged core type for Git interop. |
| 105 | pub fn to_git_object_id(&self) -> Result<GitObjectId, BindingEncodeError> { |
| 106 | match self { |
| 107 | GitOid::Sha1(bytes) => { |
| 108 | GitObjectId::new(GitHashAlgorithm::Sha1, bytes.to_vec()).map_err(Into::into) |
| 109 | } |
| 110 | GitOid::Sha256(bytes) => { |
| 111 | GitObjectId::new(GitHashAlgorithm::Sha256, bytes.to_vec()).map_err(Into::into) |
| 112 | } |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | /// Raw digest bytes. |
| 117 | pub fn as_bytes(&self) -> &[u8] { |
no outgoing calls