From 7d7f380e3075be51198f0ad457cc766f0641d984 Mon Sep 17 00:00:00 2001 From: Daniel López Azaña Date: Sun, 7 Apr 2024 21:14:31 +0200 Subject: ⬆️ (Cargo.toml): bump version from 0.1.6 to 0.1.7 for new release ♻️ (various): refactor code to use underscore prefix for unused variables ✨ (ls_client.rs): add constants for WebSocket connection setup ✨ (various): add unimplemented!() stubs for methods to be implemented 🔥 (main.rs): remove unused imports and commented code 🔥 (ls_client.rs): remove unused HashMap import and commented code 🐛 (subscription.rs): fix get_command_value to correctly format key before lookup 🔧 (Cargo.toml): remove hyper dependency as it's no longer used MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/subscription.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/subscription.rs') diff --git a/src/subscription.rs b/src/subscription.rs index 07c580c..9252ee6 100644 --- a/src/subscription.rs +++ b/src/subscription.rs @@ -177,7 +177,7 @@ impl Subscription { self.listeners.retain(|l| { let l_ref = l.as_ref() as &dyn SubscriptionListener; let listener_ref = listener as &dyn SubscriptionListener; - !(l_ref as *const dyn SubscriptionListener == listener_ref as *const dyn SubscriptionListener) + !(std::ptr::addr_of!(*l_ref) == std::ptr::addr_of!(*listener_ref)) }); } @@ -764,8 +764,9 @@ impl Subscription { /// # Returns /// The current value for the specified field of the specified key within the specified item (possibly `None`), or `None` if the specified key has not been added yet (note that it might have been added and eventually deleted). pub fn get_command_value(&self, item_pos: usize, key: &str, field_pos: usize) -> Option<&String> { + let key = format!("{}_{}", item_pos, key); self.command_values - .get(key) + .get(&key) .and_then(|fields| fields.get(&field_pos)) } -- cgit v1.2.3