From 9835e2ae736235810b4ea1c162ca5e65c547e770 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 18 May 2024 04:49:50 +0200 Subject: Merging upstream version 1.71.1+dfsg1. Signed-off-by: Daniel Baumann --- vendor/gix-hash/src/kind.rs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'vendor/gix-hash/src/kind.rs') 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 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 { -- cgit v1.2.3