diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:50 +0000 |
commit | 9835e2ae736235810b4ea1c162ca5e65c547e770 (patch) | |
tree | 3fcebf40ed70e581d776a8a4c65923e8ec20e026 /vendor/gix-hash/src/kind.rs | |
parent | Releasing progress-linux version 1.70.0+dfsg2-1~progress7.99u1. (diff) | |
download | rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.tar.xz rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.zip |
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gix-hash/src/kind.rs')
-rw-r--r-- | vendor/gix-hash/src/kind.rs | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/vendor/gix-hash/src/kind.rs b/vendor/gix-hash/src/kind.rs index 86faddda2..902cf705d 100644 --- a/vendor/gix-hash/src/kind.rs +++ b/vendor/gix-hash/src/kind.rs @@ -2,12 +2,6 @@ use std::{convert::TryFrom, str::FromStr}; use crate::{oid, Kind, ObjectId}; -impl Default for Kind { - fn default() -> Self { - Kind::Sha1 - } -} - impl TryFrom<u8> for Kind { type Error = u8; @@ -39,13 +33,13 @@ impl std::fmt::Display for Kind { } impl Kind { - /// Returns the shortest hash we support + /// Returns the shortest hash we support. #[inline] pub const fn shortest() -> Self { Self::Sha1 } - /// Returns the longest hash we support + /// Returns the longest hash we support. #[inline] pub const fn longest() -> Self { Self::Sha1 @@ -63,14 +57,14 @@ impl Kind { [0u8; Kind::longest().len_in_bytes()] } - /// Returns the amount of ascii-characters needed to encode this has in hex + /// Returns the amount of ascii-characters needed to encode this has in hex. #[inline] pub const fn len_in_hex(&self) -> usize { match self { Kind::Sha1 => 40, } } - /// Returns the amount of bytes taken up by the hash of the current kind + /// Returns the amount of bytes taken up by the hash of the current kind. #[inline] pub const fn len_in_bytes(&self) -> usize { match self { |