aboutsummaryrefslogtreecommitdiffstats
path: root/gitolfs3-common/src
diff options
context:
space:
mode:
Diffstat (limited to 'gitolfs3-common/src')
-rw-r--r--gitolfs3-common/src/lib.rs8
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 @@
1use chrono::{DateTime, Utc}; 1use chrono::{DateTime, Utc};
2use serde::{de, Deserialize, Serialize}; 2use serde::{Deserialize, Serialize, de};
3use std::{ 3use 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
165fn parse_hex_exact(value: &str, buf: &mut [u8]) -> Result<(), ParseHexError> { 165fn 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() {