From 01b70468fc1a6f7275460bfd414cdf595070522f Mon Sep 17 00:00:00 2001 From: Daniel López Azaña Date: Sun, 7 Apr 2024 20:24:35 +0200 Subject: ✨ (Cargo.toml): bump version to 0.1.5 for new release ✨ (ls_client.rs): add TLCP_VERSION constant for protocol version tracking ♻️ (ls_client.rs): remove commented-out code and unused println for cleaner codebase ♻️ (ls_client.rs): use TLCP_VERSION constant instead of hardcoded protocol string ✨ (ls_client.rs): handle 'reqok' server message for better server communication ♻️ (subscription.rs): change error type to Box for more generic error handling 🐛 (subscription.rs): fix error message to be more descriptive when items or fields are missing 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 e008804..07c580c 100644 --- a/src/subscription.rs +++ b/src/subscription.rs @@ -1,5 +1,6 @@ use crate::subscription_listener::SubscriptionListener; use std::collections::HashMap; +use std::error::Error; use std::fmt::{self, Debug, Formatter}; /// Enum representing the snapshot delivery preferences to be requested to Lightstreamer Server for the items in the Subscription. @@ -116,9 +117,9 @@ impl Subscription { mode: SubscriptionMode, items: Option>, fields: Option>, - ) -> Result { + ) -> Result> { if items.is_none() || fields.is_none() { - return Err("Items and fields must be provided".to_string()); + return Err("Items and fields must be provided".to_string().into()); } Ok(Subscription { -- cgit v1.2.3