From b21c89c81c23f656245aaceec0d816a76935d1f2 Mon Sep 17 00:00:00 2001 From: RenovateBot Date: Fri, 27 Oct 2023 02:02:18 +0200 Subject: [PATCH 1/2] Update Rust crate futures to 0.3.29 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 143542b..f2be733 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ anyhow = { version = "1.0.75", features = ["backtrace"] } reqwest = "0.11.22" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" -futures = "0.3.28" +futures = "0.3.29" tokio = { version = "1.33.0", features=["macros", "rt-multi-thread"] } tibber = "0.5.0" chrono = "0.4.31" From 47aab2fc75772d77861e37af3d96676111c879ae Mon Sep 17 00:00:00 2001 From: hodasemi Date: Mon, 30 Oct 2023 06:49:59 +0100 Subject: [PATCH 2/2] Fix equality check --- src/action.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/action.rs b/src/action.rs index 394b4e1..ca5e61c 100644 --- a/src/action.rs +++ b/src/action.rs @@ -44,7 +44,7 @@ impl FromStr for ActionType { #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] pub struct ActionID(pub(crate) i64); -#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Serialize)] +#[derive(Debug, Clone, Eq, PartialOrd, Ord, Serialize)] pub struct Action { #[serde(skip)] pub(crate) id: Option, @@ -70,6 +70,20 @@ impl Action { } } +impl PartialEq for Action { + fn eq(&self, other: &Self) -> bool { + let id_comp = match (self.id, other.id) { + (Some(self_id), Some(other_id)) => self_id == other_id, + _ => true, + }; + + id_comp + && self.device_id == other.device_id + && self.action_type == other.action_type + && self.parameter == other.parameter + } +} + #[derive(Debug, Default, Clone, PartialEq, Eq, Serialize)] pub struct ActionSet { actions: Vec,