diff options
author | 2025-04-08 22:56:40 +0200 | |
---|---|---|
committer | 2025-04-08 22:56:40 +0200 | |
commit | 294d634601bdd71f056101c64e00d7a5a7fc5ae2 (patch) | |
tree | a9b24201cc1ed44d9a470a03a2a9066bc98cb83f /gitolfs3-common/src | |
parent | 4a26f611b697907110459631da4d4a0f049440f9 (diff) | |
download | gitolfs3-main.tar.gz gitolfs3-main.zip |
Diffstat (limited to 'gitolfs3-common/src')
-rw-r--r-- | gitolfs3-common/src/lib.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gitolfs3-common/src/lib.rs b/gitolfs3-common/src/lib.rs index 917f566..bac5729 100644 --- a/gitolfs3-common/src/lib.rs +++ b/gitolfs3-common/src/lib.rs | |||
@@ -1,5 +1,5 @@ | |||
1 | use chrono::{DateTime, Utc}; | 1 | use chrono::{DateTime, Utc}; |
2 | use serde::{de, Deserialize, Serialize}; | 2 | use serde::{Deserialize, Serialize, de}; |
3 | use std::{ | 3 | use std::{ |
4 | fmt::{self, Write}, | 4 | fmt::{self, Write}, |
5 | ops, | 5 | ops, |
@@ -163,13 +163,13 @@ impl fmt::Display for ReadHexError { | |||
163 | } | 163 | } |
164 | 164 | ||
165 | fn parse_hex_exact(value: &str, buf: &mut [u8]) -> Result<(), ParseHexError> { | 165 | fn parse_hex_exact(value: &str, buf: &mut [u8]) -> Result<(), ParseHexError> { |
166 | if value.bytes().len() % 2 == 1 { | 166 | if value.len() % 2 == 1 { |
167 | return Err(ParseHexError::UnevenNibbles); | 167 | return Err(ParseHexError::UnevenNibbles); |
168 | } | 168 | } |
169 | if value.bytes().len() < 2 * buf.len() { | 169 | if value.len() < 2 * buf.len() { |
170 | return Err(ParseHexError::TooShort); | 170 | return Err(ParseHexError::TooShort); |
171 | } | 171 | } |
172 | if value.bytes().len() > 2 * buf.len() { | 172 | if value.len() > 2 * buf.len() { |
173 | return Err(ParseHexError::TooLong); | 173 | return Err(ParseHexError::TooLong); |
174 | } | 174 | } |
175 | for (i, c) in value.bytes().enumerate() { | 175 | for (i, c) in value.bytes().enumerate() { |