diff options
Diffstat (limited to 'src/subscription.rs')
-rw-r--r-- | src/subscription.rs | 5 |
1 files changed, 3 insertions, 2 deletions
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<Vec<String>>, fields: Option<Vec<String>>, - ) -> Result<Subscription, String> { + ) -> Result<Subscription, Box<dyn Error>> { 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 { |