From da8c7f331b9d84700c31a09af06da47b0afdec64 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Thu, 2 Nov 2023 08:30:08 +0100 Subject: [PATCH] Rename serialize feature to serde Follow rust API guidelines: https://rust-lang.github.io/api-guidelines/naming.html#feature-names-are-free-of-placeholder-words-c-feature --- Cargo.toml | 4 ++-- README.md | 4 ++-- src/behaviour.rs | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 82eb0a9..d884a2a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,8 +19,8 @@ name = "simple" name = "multiple" [features] -default = ["serialize"] -serialize = ["serde"] +default = ["serde"] +serde = ["dep:serde"] [dependencies] bevy = { version = "0.11", default-features = false, features = [ diff --git a/README.md b/README.md index c2a8a54..830ea39 100644 --- a/README.md +++ b/README.md @@ -45,13 +45,13 @@ Aviable and compatible versions # Features -- serialize (default): for serialization support for all types (usable for save and load settings) +- `serde` (default): for serialization support for all types through [`serde`](https://serde.rs) (useful for save and load settings) ```toml virtual_joystick = { version = "*", default-features = false, - features = [ "serialize" ] + features = [ "serde" ] } ``` diff --git a/src/behaviour.rs b/src/behaviour.rs index 3b6f088..3212230 100644 --- a/src/behaviour.rs +++ b/src/behaviour.rs @@ -1,10 +1,10 @@ use bevy::prelude::*; -#[cfg(feature = "serialize")] +#[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; #[derive(Reflect, Clone, Copy, Debug, Default, PartialEq, Eq)] -#[cfg_attr(feature = "serialize", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub enum VirtualJoystickAxis { #[default] Both, @@ -35,7 +35,7 @@ impl VirtualJoystickAxis { } #[derive(Reflect, Clone, Copy, Debug, Default, PartialEq, Eq)] -#[cfg_attr(feature = "serialize", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub enum VirtualJoystickType { /// Static position Fixed,