From 489398a63de9e68847358b34b083cae3098ed0cf Mon Sep 17 00:00:00 2001 From: adamspofford-dfinity <93943719+adamspofford-dfinity@users.noreply.github.com> Date: Fri, 11 Feb 2022 13:23:48 -0800 Subject: [PATCH] Update sha2 dep to 0.10.1 (#12) --- Cargo.toml | 2 +- src/principal.rs | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 64f8fba..2d31df8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ include = ["src", "Cargo.toml", "LICENSE", "README.md"] base32 = "0.4.0" crc32fast = "1.3.0" hex = "0.4.3" -sha2 = "0.9.8" +sha2 = "0.10.1" thiserror = "1.0.30" [dev-dependencies] diff --git a/src/principal.rs b/src/principal.rs index 62b75a1..c05307a 100644 --- a/src/principal.rs +++ b/src/principal.rs @@ -391,7 +391,10 @@ impl<'de> serde::Deserialize<'de> for Principal { } mod inner { - use sha2::{digest::generic_array::typenum::Unsigned, Digest, Sha224}; + use sha2::{ + digest::{generic_array::typenum::Unsigned, OutputSizeUser}, + Sha224, + }; /// Inner structure of a Principal. This is not meant to be public as the different classes /// of principals are not public. @@ -410,7 +413,8 @@ mod inner { } impl PrincipalInner { - const HASH_LEN_IN_BYTES: usize = <::OutputSize as Unsigned>::USIZE; // 28 + const HASH_LEN_IN_BYTES: usize = + <::OutputSize as Unsigned>::USIZE; // 28 const MAX_LENGTH_IN_BYTES: usize = Self::HASH_LEN_IN_BYTES + 1; // 29 pub const fn new() -> Self {