mirror of
https://codeberg.org/demostf/backup.git
synced 2026-06-03 09:54:18 +02:00
remove unneeded allocation
This commit is contained in:
parent
582fb38a7f
commit
cb8fbf51f7
1 changed files with 2 additions and 2 deletions
|
|
@ -37,13 +37,13 @@ where
|
|||
use hex::FromHex;
|
||||
use serde::de::Error;
|
||||
|
||||
let string = String::deserialize(deserializer)?;
|
||||
let string = <&str>::deserialize(deserializer)?;
|
||||
|
||||
if string.len() == 0 {
|
||||
return Ok(Digest([0; 16]));
|
||||
}
|
||||
|
||||
<[u8; 16]>::from_hex(&string)
|
||||
<[u8; 16]>::from_hex(string)
|
||||
.map_err(|err| Error::custom(err.to_string()))
|
||||
.map(Digest)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue