From f3a792e3255ea7ef40033a4849f76e5973dac6b3 Mon Sep 17 00:00:00 2001 From: Tom <25043847+Douile@users.noreply.github.com> Date: Mon, 26 Jun 2023 23:12:57 +0000 Subject: [PATCH] [Crate] Swap no_games, no_services for games, services (#61) --- Cargo.toml | 8 ++++---- src/lib.rs | 14 +++++++------- src/protocols/types.rs | 12 ++++++------ 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ec1a6ea..d1ee210 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,10 +17,10 @@ keywords = ["server", "query", "game", "check", "status"] rust-version = "1.60.0" [features] -default = ["game_defs"] -no_games = [] -no_services = [] -game_defs = ["dep:phf"] +default = ["games", "services", "game_defs"] +games = [] +services = [] +game_defs = ["dep:phf", "games"] serde = ["dep:serde", "serde/derive"] [dependencies] diff --git a/src/lib.rs b/src/lib.rs index bb19572..b902b9c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -26,19 +26,19 @@ //! ``` //! //! # Crate features: -//! Enabled by default: `game_defs` +//! Enabled by default: `games`, `game_defs`, `services` //! //! `serde` - enables json serialization/deserialization for all response types. -//!
`no_games` - disables the included games support.
-//! `no_services` - disables the included services support.
+//!
`games` - include games support.
+//! `services` - include services support.
//! `game_defs` - Include game definitions for programmatic access (enabled by //! default). pub mod errors; -#[cfg(not(feature = "no_games"))] +#[cfg(feature = "games")] pub mod games; pub mod protocols; -#[cfg(not(feature = "no_services"))] +#[cfg(feature = "services")] pub mod services; mod bufferer; @@ -46,7 +46,7 @@ mod socket; mod utils; pub use errors::*; -#[cfg(not(feature = "no_games"))] +#[cfg(feature = "games")] pub use games::*; -#[cfg(not(feature = "no_services"))] +#[cfg(feature = "services")] pub use services::*; diff --git a/src/protocols/types.rs b/src/protocols/types.rs index f02f383..9b7f7dd 100644 --- a/src/protocols/types.rs +++ b/src/protocols/types.rs @@ -23,7 +23,7 @@ pub enum Protocol { Minecraft(Option), Quake(quake::QuakeVersion), Valve(valve::SteamApp), - #[cfg(not(feature = "no_games"))] + #[cfg(feature = "games")] PROPRIETARY(ProprietaryProtocol), } @@ -34,11 +34,11 @@ pub enum GenericResponse<'a> { Minecraft(minecraft::VersionedResponse<'a>), Quake(quake::VersionedResponse<'a>), Valve(&'a valve::Response), - #[cfg(not(feature = "no_games"))] + #[cfg(feature = "games")] TheShip(&'a crate::games::ts::Response), - #[cfg(not(feature = "no_games"))] + #[cfg(feature = "games")] FFOW(&'a crate::games::ffow::Response), - #[cfg(not(feature = "no_games"))] + #[cfg(feature = "games")] JC2MP(&'a crate::games::jc2mp::Response), } @@ -50,9 +50,9 @@ pub enum GenericPlayer<'a> { QuakeTwo(&'a quake::two::Player), Minecraft(&'a minecraft::Player), Gamespy(gamespy::VersionedPlayer<'a>), - #[cfg(not(feature = "no_games"))] + #[cfg(feature = "games")] TheShip(&'a crate::games::ts::TheShipPlayer), - #[cfg(not(feature = "no_games"))] + #[cfg(feature = "games")] JCMP2(&'a crate::games::jc2mp::Player), }