Skip to content

Commit 84788c9

Browse files
Rename serde_support feature to serde
The old feature name was a workaround for a Cargo limitation that no longer exists.
1 parent 3ae0ee3 commit 84788c9

File tree

8 files changed

+23
-46
lines changed

8 files changed

+23
-46
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ This project adheres to Semantic Versioning.
1515

1616
### Changed
1717

18+
* **Breaking:** The `serde_support` feature was renamed to `serde`.
1819
* **Breaking:** Updated `vek` to 0.17.
1920
* **Breaking:** Updated `rodio` to 0.20.
2021
* **Breaking:** Updated `image` to 0.25.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ texture_dds = ["image/dds"]
7070
texture_tga = ["image/tga"]
7171

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

7575
# Compiles SDL2 from source (see https://github.com/Rust-SDL2/rust-sdl2#bundled-feature).
7676
sdl2_bundled = ["sdl2/bundled"]

src/context.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl Context {
6161
running: false,
6262
quit_on_escape: settings.quit_on_escape,
6363

64-
fps_limit: settings.fps_limit
64+
fps_limit: settings.fps_limit,
6565
})
6666
}
6767

@@ -190,18 +190,15 @@ impl Context {
190190
/// # Serde
191191
///
192192
/// Serialization and deserialization of this type (via [Serde](https://serde.rs/))
193-
/// can be enabled via the `serde_support` feature.
193+
/// can be enabled via the `serde` feature.
194194
///
195195
/// Note that the available settings could change between releases of
196196
/// Tetra (semver permitting). If you need a config file schema that will
197197
/// be stable in the long term, consider making your own and then mapping
198198
/// it to Tetra's API, rather than relying on `ContextBuilder` to not
199199
/// change.
200200
#[derive(Debug, Clone)]
201-
#[cfg_attr(
202-
feature = "serde_support",
203-
derive(serde::Serialize, serde::Deserialize)
204-
)]
201+
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
205202
pub struct ContextBuilder {
206203
pub(crate) title: String,
207204
pub(crate) window_width: i32,

src/graphics/color.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ use crate::math::Vec4;
1919
/// # Serde
2020
///
2121
/// Serialization and deserialization of this type (via [Serde](https://serde.rs/))
22-
/// can be enabled via the `serde_support` feature.
22+
/// can be enabled via the `serde` feature.
2323
#[repr(C)]
2424
#[derive(Debug, Default, Copy, Clone, PartialEq)]
2525
#[cfg_attr(
26-
feature = "serde_support",
26+
feature = "serde",
2727
derive(serde::Serialize, serde::Deserialize)
2828
)]
2929
pub struct Color {

src/graphics/rectangle.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ use crate::math::Vec2;
99
/// # Serde
1010
///
1111
/// Serialization and deserialization of this type (via [Serde](https://serde.rs/))
12-
/// can be enabled via the `serde_support` feature.
12+
/// can be enabled via the `serde` feature.
1313
#[derive(Debug, Copy, Clone, PartialEq, Eq, Default, Hash)]
1414
#[cfg_attr(
15-
feature = "serde_support",
15+
feature = "serde",
1616
derive(serde::Serialize, serde::Deserialize)
1717
)]
1818
pub struct Rectangle<T = f32> {

src/input/gamepad.rs

+6-15
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,10 @@ impl GamepadState {
5252
/// # Serde
5353
///
5454
/// Serialization and deserialization of this type (via [Serde](https://serde.rs/))
55-
/// can be enabled via the `serde_support` feature.
55+
/// can be enabled via the `serde` feature.
5656
#[non_exhaustive]
5757
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
58-
#[cfg_attr(
59-
feature = "serde_support",
60-
derive(serde::Serialize, serde::Deserialize)
61-
)]
58+
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
6259
#[allow(missing_docs)]
6360
pub enum GamepadButton {
6461
A,
@@ -85,13 +82,10 @@ pub enum GamepadButton {
8582
/// # Serde
8683
///
8784
/// Serialization and deserialization of this type (via [Serde](https://serde.rs/))
88-
/// can be enabled via the `serde_support` feature.
85+
/// can be enabled via the `serde` feature.
8986
#[non_exhaustive]
9087
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
91-
#[cfg_attr(
92-
feature = "serde_support",
93-
derive(serde::Serialize, serde::Deserialize)
94-
)]
88+
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9589
#[allow(missing_docs)]
9690
pub enum GamepadAxis {
9791
LeftStickX,
@@ -107,13 +101,10 @@ pub enum GamepadAxis {
107101
/// # Serde
108102
///
109103
/// Serialization and deserialization of this type (via [Serde](https://serde.rs/))
110-
/// can be enabled via the `serde_support` feature.
104+
/// can be enabled via the `serde` feature.
111105
#[non_exhaustive]
112106
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
113-
#[cfg_attr(
114-
feature = "serde_support",
115-
derive(serde::Serialize, serde::Deserialize)
116-
)]
107+
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
117108
#[allow(missing_docs)]
118109
pub enum GamepadStick {
119110
LeftStick,

src/input/keyboard.rs

+6-15
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,10 @@ use crate::Context;
2020
/// # Serde
2121
///
2222
/// Serialization and deserialization of this type (via [Serde](https://serde.rs/))
23-
/// can be enabled via the `serde_support` feature.
23+
/// can be enabled via the `serde` feature.
2424
#[non_exhaustive]
2525
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
26-
#[cfg_attr(
27-
feature = "serde_support",
28-
derive(serde::Serialize, serde::Deserialize)
29-
)]
26+
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
3027
#[allow(missing_docs)]
3128
pub enum Key {
3229
A,
@@ -163,13 +160,10 @@ pub enum Key {
163160
/// # Serde
164161
///
165162
/// Serialization and deserialization of this type (via [Serde](https://serde.rs/))
166-
/// can be enabled via the `serde_support` feature.
163+
/// can be enabled via the `serde` feature.
167164
#[non_exhaustive]
168165
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
169-
#[cfg_attr(
170-
feature = "serde_support",
171-
derive(serde::Serialize, serde::Deserialize)
172-
)]
166+
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
173167
#[allow(missing_docs)]
174168
pub enum KeyLabel {
175169
A,
@@ -463,13 +457,10 @@ impl Display for KeyLabel {
463457
/// # Serde
464458
///
465459
/// Serialization and deserialization of this type (via [Serde](https://serde.rs/))
466-
/// can be enabled via the `serde_support` feature.
460+
/// can be enabled via the `serde` feature.
467461
#[non_exhaustive]
468462
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
469-
#[cfg_attr(
470-
feature = "serde_support",
471-
derive(serde::Serialize, serde::Deserialize)
472-
)]
463+
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
473464
#[allow(missing_docs)]
474465
pub enum KeyModifier {
475466
Ctrl,

src/input/mouse.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,10 @@ use crate::Context;
66
/// # Serde
77
///
88
/// Serialization and deserialization of this type (via [Serde](https://serde.rs/))
9-
/// can be enabled via the `serde_support` feature.
9+
/// can be enabled via the `serde` feature.
1010
#[non_exhaustive]
1111
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
12-
#[cfg_attr(
13-
feature = "serde_support",
14-
derive(serde::Serialize, serde::Deserialize)
15-
)]
12+
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1613
#[allow(missing_docs)]
1714
pub enum MouseButton {
1815
Left,

0 commit comments

Comments
 (0)