From 12317b98a0cc145e717e9da3cdbe8bc1ff8fc4f1 Mon Sep 17 00:00:00 2001 From: Zeyla Hellyer Date: Fri, 3 Nov 2017 21:34:51 -0700 Subject: Fix Client's framework set The Client would create two Arc's containing unique instances of a user's given Framework, one given to the ShardManager and one kept on the Client. This would result in the user's Framework on the Client being set, but the other left untouched and permanently staying empty. --- src/client/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/client/mod.rs b/src/client/mod.rs index 2a97c91..16e61fa 100644 --- a/src/client/mod.rs +++ b/src/client/mod.rs @@ -322,9 +322,9 @@ impl Client { ); Client { - framework: Arc::new(Mutex::new(None)), token: locked, ws_uri: url, + framework, data, shard_manager, shard_manager_worker, @@ -453,7 +453,7 @@ impl Client { /// [framework docs]: ../framework/index.html #[cfg(feature = "framework")] pub fn with_framework(&mut self, f: F) { - self.framework = Arc::new(Mutex::new(Some(Box::new(f)))); + *self.framework.lock() = Some(Box::new(f)); } /// Establish the connection and start listening for events. -- cgit v1.2.3