aboutsummaryrefslogtreecommitdiff
path: root/src/subscription.rs
diff options
context:
space:
mode:
authorLibravatar Daniel López Azaña <daniloaz@gmail.com>2024-04-07 21:14:31 +0200
committerLibravatar Daniel López Azaña <daniloaz@gmail.com>2024-04-07 21:14:31 +0200
commit7d7f380e3075be51198f0ad457cc766f0641d984 (patch)
tree8e88175cd34b594a338ad6b556e8c024a95eccca /src/subscription.rs
parent2a68c66704798bf956ac132ab8309212af7fd1c4 (diff)
⬆️ (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
Diffstat (limited to 'src/subscription.rs')
-rw-r--r--src/subscription.rs5
1 files changed, 3 insertions, 2 deletions
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))
}