Skip to content

Commit

Permalink
Rename serde_support feature to serde
Browse files Browse the repository at this point in the history
The old feature name was a workaround for a Cargo limitation that no longer exists.
  • Loading branch information
17cupsofcoffee committed Dec 10, 2024
1 parent 3ae0ee3 commit 84788c9
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 46 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This project adheres to Semantic Versioning.

### Changed

* **Breaking:** The `serde_support` feature was renamed to `serde`.
* **Breaking:** Updated `vek` to 0.17.
* **Breaking:** Updated `rodio` to 0.20.
* **Breaking:** Updated `image` to 0.25.
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ texture_dds = ["image/dds"]
texture_tga = ["image/tga"]

# Enables support for serialization/deserialization via Serde.
serde_support = ["serde", "vek/serde"]
serde = ["dep:serde", "vek/serde"]

# Compiles SDL2 from source (see https://github.com/Rust-SDL2/rust-sdl2#bundled-feature).
sdl2_bundled = ["sdl2/bundled"]
Expand Down
9 changes: 3 additions & 6 deletions src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl Context {
running: false,
quit_on_escape: settings.quit_on_escape,

fps_limit: settings.fps_limit
fps_limit: settings.fps_limit,
})
}

Expand Down Expand Up @@ -190,18 +190,15 @@ impl Context {
/// # Serde
///
/// Serialization and deserialization of this type (via [Serde](https://serde.rs/))
/// can be enabled via the `serde_support` feature.
/// can be enabled via the `serde` feature.
///
/// Note that the available settings could change between releases of
/// Tetra (semver permitting). If you need a config file schema that will
/// be stable in the long term, consider making your own and then mapping
/// it to Tetra's API, rather than relying on `ContextBuilder` to not
/// change.
#[derive(Debug, Clone)]
#[cfg_attr(
feature = "serde_support",
derive(serde::Serialize, serde::Deserialize)
)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct ContextBuilder {
pub(crate) title: String,
pub(crate) window_width: i32,
Expand Down
4 changes: 2 additions & 2 deletions src/graphics/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ use crate::math::Vec4;
/// # Serde
///
/// Serialization and deserialization of this type (via [Serde](https://serde.rs/))
/// can be enabled via the `serde_support` feature.
/// can be enabled via the `serde` feature.
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq)]
#[cfg_attr(
feature = "serde_support",
feature = "serde",
derive(serde::Serialize, serde::Deserialize)
)]
pub struct Color {
Expand Down
4 changes: 2 additions & 2 deletions src/graphics/rectangle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ use crate::math::Vec2;
/// # Serde
///
/// Serialization and deserialization of this type (via [Serde](https://serde.rs/))
/// can be enabled via the `serde_support` feature.
/// can be enabled via the `serde` feature.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Default, Hash)]
#[cfg_attr(
feature = "serde_support",
feature = "serde",
derive(serde::Serialize, serde::Deserialize)
)]
pub struct Rectangle<T = f32> {
Expand Down
21 changes: 6 additions & 15 deletions src/input/gamepad.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,10 @@ impl GamepadState {
/// # Serde
///
/// Serialization and deserialization of this type (via [Serde](https://serde.rs/))
/// can be enabled via the `serde_support` feature.
/// can be enabled via the `serde` feature.
#[non_exhaustive]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
#[cfg_attr(
feature = "serde_support",
derive(serde::Serialize, serde::Deserialize)
)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[allow(missing_docs)]
pub enum GamepadButton {
A,
Expand All @@ -85,13 +82,10 @@ pub enum GamepadButton {
/// # Serde
///
/// Serialization and deserialization of this type (via [Serde](https://serde.rs/))
/// can be enabled via the `serde_support` feature.
/// can be enabled via the `serde` feature.
#[non_exhaustive]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
#[cfg_attr(
feature = "serde_support",
derive(serde::Serialize, serde::Deserialize)
)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[allow(missing_docs)]
pub enum GamepadAxis {
LeftStickX,
Expand All @@ -107,13 +101,10 @@ pub enum GamepadAxis {
/// # Serde
///
/// Serialization and deserialization of this type (via [Serde](https://serde.rs/))
/// can be enabled via the `serde_support` feature.
/// can be enabled via the `serde` feature.
#[non_exhaustive]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
#[cfg_attr(
feature = "serde_support",
derive(serde::Serialize, serde::Deserialize)
)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[allow(missing_docs)]
pub enum GamepadStick {
LeftStick,
Expand Down
21 changes: 6 additions & 15 deletions src/input/keyboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,10 @@ use crate::Context;
/// # Serde
///
/// Serialization and deserialization of this type (via [Serde](https://serde.rs/))
/// can be enabled via the `serde_support` feature.
/// can be enabled via the `serde` feature.
#[non_exhaustive]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
#[cfg_attr(
feature = "serde_support",
derive(serde::Serialize, serde::Deserialize)
)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[allow(missing_docs)]
pub enum Key {
A,
Expand Down Expand Up @@ -163,13 +160,10 @@ pub enum Key {
/// # Serde
///
/// Serialization and deserialization of this type (via [Serde](https://serde.rs/))
/// can be enabled via the `serde_support` feature.
/// can be enabled via the `serde` feature.
#[non_exhaustive]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
#[cfg_attr(
feature = "serde_support",
derive(serde::Serialize, serde::Deserialize)
)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[allow(missing_docs)]
pub enum KeyLabel {
A,
Expand Down Expand Up @@ -463,13 +457,10 @@ impl Display for KeyLabel {
/// # Serde
///
/// Serialization and deserialization of this type (via [Serde](https://serde.rs/))
/// can be enabled via the `serde_support` feature.
/// can be enabled via the `serde` feature.
#[non_exhaustive]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
#[cfg_attr(
feature = "serde_support",
derive(serde::Serialize, serde::Deserialize)
)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[allow(missing_docs)]
pub enum KeyModifier {
Ctrl,
Expand Down
7 changes: 2 additions & 5 deletions src/input/mouse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@ use crate::Context;
/// # Serde
///
/// Serialization and deserialization of this type (via [Serde](https://serde.rs/))
/// can be enabled via the `serde_support` feature.
/// can be enabled via the `serde` feature.
#[non_exhaustive]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
#[cfg_attr(
feature = "serde_support",
derive(serde::Serialize, serde::Deserialize)
)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[allow(missing_docs)]
pub enum MouseButton {
Left,
Expand Down

0 comments on commit 84788c9

Please sign in to comment.