LuckyTurtleDev / mstickereditor

import sticker packs from telegram, to be used at the Maunium sticker picker for Matrix
Apache License 2.0
30 stars 3 forks source link

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

Open msrd0 opened 1 year ago

msrd0 commented 1 year ago

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 commented 6 months ago

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