feat(tvix/castore): impl Debug for B3Digest
Use the same format as Display, b3: followed by the base64 representation. This makes the debug implementation of everything containing a b3 digest much nicer to read. Change-Id: I3ca3154d0b6fb07781c8f9c83ece3ff1a6957902 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11181 Autosubmit: flokli <flokli@flokli.de> Reviewed-by: Connor Brewster <cbrewster@hey.com> Tested-by: BuildkiteCI
This commit is contained in:
parent
fa8e706b9b
commit
3b1c9172f6
1 changed files with 7 additions and 1 deletions
|
@ -2,7 +2,7 @@ use bytes::Bytes;
|
|||
use data_encoding::BASE64;
|
||||
use thiserror::Error;
|
||||
|
||||
#[derive(PartialEq, Eq, Hash, Debug)]
|
||||
#[derive(PartialEq, Eq, Hash)]
|
||||
pub struct B3Digest(Bytes);
|
||||
|
||||
// TODO: allow converting these errors to crate::Error
|
||||
|
@ -78,3 +78,9 @@ impl std::fmt::Display for B3Digest {
|
|||
write!(f, "b3:{}", BASE64.encode(&self.0))
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for B3Digest {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(f, "b3:{}", BASE64.encode(&self.0))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue