From 68f73131aa0f993bfc1bfa622be63f8862661c16 Mon Sep 17 00:00:00 2001 From: Daniel López Azaña Date: Thu, 28 Mar 2024 20:55:23 +0100 Subject: ♻️ (ls_client.rs): refactor connect method to check server_address before connecting ✨ (main.rs): rename subscription to my_subscription for clarity ✨ (main.rs): move subscription setup before client creation ✨ (main.rs): add client.subscribe and client.connect calls to main function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ls_client.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/ls_client.rs') diff --git a/src/ls_client.rs b/src/ls_client.rs index 214a722..59dd247 100644 --- a/src/ls_client.rs +++ b/src/ls_client.rs @@ -148,7 +148,10 @@ impl LightstreamerClient { /// /// See also `ConnectionDetails.setServerAddress()` pub fn connect(&mut self) -> Result<(), IllegalStateException> { - // Implementation for connect + if self.server_address.is_none() { + return Err(IllegalStateException::new("No server address was configured.")); + } + Ok(()) } -- cgit v1.2.3