aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLibravatar Daniel López Azaña <daniloaz@gmail.com>2024-04-07 20:32:51 +0200
committerLibravatar Daniel López Azaña <daniloaz@gmail.com>2024-04-07 20:32:51 +0200
commit2a68c66704798bf956ac132ab8309212af7fd1c4 (patch)
tree7f51020455c94eb735e70a18c389efcbc69b0a95 /src
parent01b70468fc1a6f7275460bfd414cdf595070522f (diff)
✨ (Cargo.toml): bump version to 0.1.6 for new release
✨ (ls_client.rs): add LS_data_adapter parameter to subscription request ♻️ (ls_client.rs): conditionally remove LS_data_adapter if empty to clean up request params
Diffstat (limited to 'src')
-rw-r--r--src/ls_client.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ls_client.rs b/src/ls_client.rs
index 95cdfba..cfd365f 100644
--- a/src/ls_client.rs
+++ b/src/ls_client.rs
@@ -443,6 +443,7 @@ impl LightstreamerClient {
// Prepare the subscription request.
//
let mut params: Vec<(&str, &str)> = vec![
+ ("LS_data_adapter", &ls_data_adapter),
("LS_reqId", &ls_req_id),
("LS_op", "add"),
("LS_subId", &ls_sub_id),
@@ -451,6 +452,10 @@ impl LightstreamerClient {
("LS_schema", &ls_schema),
("LS_ack", "false"),
];
+ // Remove the data adapter parameter if not specified.
+ if ls_data_adapter == "" {
+ params.remove(0);
+ }
if ls_snapshot != "" {
params.push(("LS_snapshot", &ls_snapshot));
}