diff --git a/src/events.rs b/src/events.rs index fb63ac6..5ac1812 100644 --- a/src/events.rs +++ b/src/events.rs @@ -13,7 +13,8 @@ pub enum Variant { BigInt(i64), Boolean(bool), String(String), - RGB(Rgb) + RGB(Rgb), + Vec(Vec) } macro_rules! impl_variant_type { @@ -44,6 +45,7 @@ impl_variant_type!(u64, BigUInt); impl_variant_type!(bool, Boolean); impl_variant_type!(String, String); impl_variant_type!(Rgb, RGB); +impl_variant_type!(Vec, Vec); impl<'a> From<&'a str> for Variant { fn from(value: &'a str) -> Self { @@ -51,22 +53,6 @@ impl<'a> From<&'a str> for Variant { } } -impl Display for Variant { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Variant::BigInt(i) => (i as &dyn Display).fmt(f), - Variant::BigUInt(i) => (i as &dyn Display).fmt(f), - Variant::Boolean(i) => (i as &dyn Display).fmt(f), - Variant::Byte(i) => (i as &dyn Display).fmt(f), - Variant::Int(i) => (i as &dyn Display).fmt(f), - Variant::String(i) => (i as &dyn Display).fmt(f), - Variant::UInt(i) => (i as &dyn Display).fmt(f), - Variant::SignedByte(b) => (b as &dyn Display).fmt(f), - Variant::RGB(rgb) => f.write_fmt(format_args!("[{}, {}, {}]", rgb.r, rgb.g, rgb.b)), - } - } -} - #[derive(Debug, Clone, PartialEq, Eq)] pub enum Event { ReadyToRock,