From 6e2d307dae00c129e2d83cac882a0a828dcd648c Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 4 May 2021 00:55:02 +0100 Subject: [PATCH] AssetUrlKey: wip, more Signed-off-by: Ian Jackson --- src/bundles.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/bundles.rs b/src/bundles.rs index bd84f294..96b49190 100644 --- a/src/bundles.rs +++ b/src/bundles.rs @@ -73,7 +73,12 @@ impl AssetUrlKey { AssetUrlKey::Y(buf) } } -pub type AssetUrlToken = digest::Output; +#[derive(Clone)] +pub struct AssetUrlToken(digest::Output); +impl Debug for AssetUrlToken { + #[throws(fmt::Error)] + fn fmt(&self, f: &mut Formatter) { write!(f, "AssetUrlToken{{..}}")?; } +} impl AssetUrlKey { pub fn token(&self, what: &str, v: V) -> AssetUrlToken where V: Serialize { @@ -85,7 +90,7 @@ impl AssetUrlKey { write!(dw, "{}\0", what).unwrap(); dw.write(&k[..]).unwrap(); rmp_serde::encode::write(&mut dw, &v).expect("serialize failed!"); - dw.finish().0 + AssetUrlToken(dw.finish().0) } } -- 2.30.2