summaryrefslogtreecommitdiffstats
path: root/vendor/gix-hash/src/prefix.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/prefix.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/prefix.rs')
-rw-r--r--vendor/gix-hash/src/prefix.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/vendor/gix-hash/src/prefix.rs b/vendor/gix-hash/src/prefix.rs
index a8b55922e..166b3c3e7 100644
--- a/vendor/gix-hash/src/prefix.rs
+++ b/vendor/gix-hash/src/prefix.rs
@@ -2,7 +2,7 @@ use std::{cmp::Ordering, convert::TryFrom};
use crate::{oid, ObjectId, Prefix};
-/// The error returned by [Prefix::new()].
+/// The error returned by [`Prefix::new()`].
#[derive(Debug, thiserror::Error)]
#[allow(missing_docs)]
pub enum Error {
@@ -17,7 +17,7 @@ pub enum Error {
///
pub mod from_hex {
- /// The error returned by [Prefix::from_hex][super::Prefix::from_hex()].
+ /// The error returned by [`Prefix::from_hex`][super::Prefix::from_hex()].
#[derive(Debug, Eq, PartialEq, thiserror::Error)]
#[allow(missing_docs)]
pub enum Error {
@@ -110,7 +110,7 @@ impl Prefix {
let mut buf = [0u8; crate::Kind::longest().len_in_hex()];
buf[..value.len()].copy_from_slice(value.as_bytes());
buf[value.len()] = b'0';
- Vec::from_hex(&buf[..value.len() + 1])
+ Vec::from_hex(&buf[..=value.len()])
}
.map_err(|e| match e {
hex::FromHexError::InvalidHexCharacter { c, index } => from_hex::Error::Invalid { c, index },