From 0adf3df8306315dc03a195dcfae855ea8a79290a Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Fri, 26 Apr 2024 21:22:19 -0700 Subject: [PATCH] Fix some things being strings --- src/main.rs | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/main.rs b/src/main.rs index d65beba..50f050e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -68,7 +68,22 @@ impl Env { } } -impl serde::Serialize for Env { +impl Serialize for Tags { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + let mut seq = serializer.serialize_seq(Some(self.0.count_ones() as usize))?; + for i in 0..32 { + if self.0 >> i & 1 == 1 { + seq.serialize_element(&(i + 1))?; + } + } + seq.end() + } +} + +impl Serialize for Env { fn serialize(&self, serializer: S) -> Result where S: Serializer { let mut state = serializer.serialize_struct("Env", 6)?; @@ -370,18 +385,3 @@ fn configuration() -> Flags { } default } - -impl Serialize for Tags { - fn serialize(&self, serializer: S) -> Result - where - S: Serializer, - { - let mut seq = serializer.serialize_seq(Some(self.0.count_ones() as usize))?; - for i in 0..32 { - if self.0 >> i & 1 == 1 { - seq.serialize_element(&format!("{}", i + 1))?; - } - } - seq.end() - } -}