diff options
| author | Zeyla Hellyer <[email protected]> | 2018-08-07 09:24:07 -0700 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2018-08-07 09:25:06 -0700 |
| commit | 39bb75cc6759ceb972c0caca0b03c7971a445eb8 (patch) | |
| tree | 343d97399ea597804f0cd30016034c4adb8efebe /src/client | |
| parent | Fix some documentation spacing (diff) | |
| download | serenity-39bb75cc6759ceb972c0caca0b03c7971a445eb8.tar.xz serenity-39bb75cc6759ceb972c0caca0b03c7971a445eb8.zip | |
Fix compilation + tests on certain feature combos
On certain feature combinations, compilation and tests would not function
correctly.
This commit goes through a number of feature combinations and gates some tests
behind the required features and fixes other compilation errors.
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/bridge/gateway/shard_messenger.rs | 10 | ||||
| -rw-r--r-- | src/client/dispatch.rs | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/client/bridge/gateway/shard_messenger.rs b/src/client/bridge/gateway/shard_messenger.rs index 6d625b6..a3b5918 100644 --- a/src/client/bridge/gateway/shard_messenger.rs +++ b/src/client/bridge/gateway/shard_messenger.rs @@ -147,9 +147,19 @@ impl ShardMessenger { /// # /// # let mut shard = Shard::new(mutex.clone(), mutex, [0, 1]).unwrap(); /// # + /// # #[cfg(feature = "model")] /// use serenity::model::gateway::Game; + /// # #[cfg(not(feature = "model"))] + /// use serenity::model::gateway::{Game, GameType}; /// + /// # #[cfg(feature = "model")] /// shard.set_game(Some(Game::playing("Heroes of the Storm"))); + /// # #[cfg(not(feature = "model"))] + /// shard.set_game(Some(Game { + /// kind: GameType::Playing, + /// name: "Heroes of the Storm".to_owned(), + /// url: None, + /// })); /// # Ok(()) /// # } /// # diff --git a/src/client/dispatch.rs b/src/client/dispatch.rs index b81b901..7a9e725 100644 --- a/src/client/dispatch.rs +++ b/src/client/dispatch.rs @@ -97,6 +97,7 @@ pub(crate) fn dispatch<H: EventHandler + Send + Sync + 'static>( } #[cfg(not(feature = "framework"))] +#[allow(unused_mut)] pub(crate) fn dispatch<H: EventHandler + Send + Sync + 'static>( event: DispatchEvent, data: &Arc<Mutex<ShareMap>>, |