1
0
Fork 0
forked from wry/wry

output: decouple identity from wayland output

This commit is contained in:
kossLAN 2026-05-29 12:45:39 -04:00
parent 59e4e6dfb7
commit a20deb0628
No known key found for this signature in database
13 changed files with 110 additions and 113 deletions

View file

@ -830,35 +830,3 @@ macro_rules! opaque {
}
};
}
macro_rules! hash_type {
($name:ident) => {
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
pub struct $name(pub [u8; 32]);
impl $name {
#[allow(clippy::allow_attributes, dead_code)]
pub fn hash(t: impl AsRef<[u8]>) -> Self {
Self(*blake3::hash(t.as_ref()).as_bytes())
}
}
impl serde::Serialize for $name {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
self.0.serialize(serializer)
}
}
impl<'de> serde::Deserialize<'de> for $name {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
<[u8; 32]>::deserialize(deserializer).map(Self)
}
}
};
}