summaryrefslogtreecommitdiffstats
path: root/vendor/gix-hash/src/kind.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
commitdc0db358abe19481e475e10c32149b53370f1a1c (patch)
treeab8ce99c4b255ce46f99ef402c27916055b899ee /vendor/gix-hash/src/kind.rs
parentReleasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff)
downloadrustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz
rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip
Merging upstream version 1.72.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.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/vendor/gix-hash/src/kind.rs b/vendor/gix-hash/src/kind.rs
index 902cf705d..ee8600b1b 100644
--- a/vendor/gix-hash/src/kind.rs
+++ b/vendor/gix-hash/src/kind.rs
@@ -57,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 bytes needed to encode this instance as hexadecimal characters.
#[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 this instance.
#[inline]
pub const fn len_in_bytes(&self) -> usize {
match self {
@@ -73,7 +73,7 @@ impl Kind {
}
/// Returns the kind of hash that would fit the given `hex_len`, or `None` if there is no fitting hash.
- /// Note that 0 as `hex_len` fits always yields Sha1.
+ /// Note that `0` as `hex_len` up to 40 always yields `Sha1`.
#[inline]
pub const fn from_hex_len(hex_len: usize) -> Option<Self> {
Some(match hex_len {
@@ -98,7 +98,7 @@ impl Kind {
}
}
- /// Create a null-id of our hash kind.
+ /// Create a shared null-id of our hash kind.
#[inline]
pub fn null_ref(&self) -> &'static oid {
match self {
@@ -106,7 +106,7 @@ impl Kind {
}
}
- /// Create a null-id of our hash kind.
+ /// Create an owned null-id of our hash kind.
#[inline]
pub const fn null(&self) -> ObjectId {
match self {