mstickereditor icon indicating copy to clipboard operation
mstickereditor copied to clipboard

`database::Hash` cannot be used as a map key

Open msrd0 opened this issue 3 years ago • 1 comments

Consider wrapping it in a newtype struct like this:

#[derive(Deserialize, Eq, Hash, PartialEq, PartialOrd, Ord, Serialize)]
#[serde(transparent)]
pub struct MediaHash(
	#[serde(with = "serde_big_array::BigArray")] pub database::Hash
);

msrd0 avatar Feb 05 '23 19:02 msrd0

Context: https://github.com/msrd0/tg2mx_bot/blob/d64de13b71da5e2f0a7b5d366648158bf5d14582/src/mxbot/state.rs#L174-L178

msrd0 avatar Apr 18 '24 12:04 msrd0