Skip to content
Extraits de code Groupes Projets
Non vérifiée Valider b5af3430 rédigé par Kubat's avatar Kubat
Parcourir les fichiers

MISC: Fix derive resolution for SHA264

parent 50090600
Branches
Aucune étiquette associée trouvée
2 requêtes de fusion!205misc debug and harderning, mostly related to repo syncing,!197Draft: Refactor the whole code.
//! Custom sha256 representation to be able to copy the damn thing and don't use stupid strings. //! Custom sha256 representation to be able to copy the damn thing and don't use stupid strings.
use derive_more::{Debug, Display}; use derive_more::{Debug as DmDebug, Display as DmDisplay};
use std::{borrow::Cow, fmt, str::FromStr}; use std::{borrow::Cow, fmt, str::FromStr};
/// Represent a sha256 digest to try to avoid allocating strings everywhere. /// Represent a sha256 digest to try to avoid allocating strings everywhere.
#[derive(Clone, Copy, PartialEq, Eq, Hash, Display, Debug)] #[derive(Clone, Copy, PartialEq, Eq, Hash, DmDisplay, DmDebug)]
#[display("{:032x}{:032x}", self.higher, self.lower)] #[display("{:032x}{:032x}", self.higher, self.lower)]
#[debug("{self}")] #[debug("{self}")]
pub struct SHA256 { pub struct SHA256 {
...@@ -12,7 +12,7 @@ pub struct SHA256 { ...@@ -12,7 +12,7 @@ pub struct SHA256 {
lower: u128, lower: u128,
} }
#[derive(Clone, Display, Debug)] #[derive(Clone, DmDisplay, DmDebug)]
#[display("{_0}")] #[display("{_0}")]
#[debug("{_0}")] #[debug("{_0}")]
pub struct SHA256Error(Cow<'static, str>); pub struct SHA256Error(Cow<'static, str>);
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter