Rename feature 'ser_de' as 'serde'

When I introduced the 'ser_de' feature, I couldn't find a way to
name it 'serde' while also make it pull the optional 'serde'
crate together with the other related dependencies.

With rustc >= 1.60 we can use 'dep:serde' to refer to the 'serde'
dependency as part of the 'serde' feature.
This commit is contained in:
François Laignel 2022-09-12 18:32:16 +02:00
parent 879d6a4548
commit 069c6a2c01
27 changed files with 69 additions and 69 deletions

View file

@ -232,7 +232,7 @@ plugins-update-nightly:
crate=$1
case "$crate" in
gstreamer-audio|gstreamer-editing-services|gstreamer-gl|gstreamer-pbutils|gstreamer-rtp|gstreamer-rtsp|gstreamer-video|gstreamer)
echo "--features=ser_de,v1_22"
echo "--features=serde,v1_22"
;;
gstreamer-validate)
echo ""
@ -428,7 +428,7 @@ clippy:
crate=$1
case "$crate" in
gstreamer-audio|gstreamer-editing-services|gstreamer-gl|gstreamer-pbutils|gstreamer-rtp|gstreamer-rtsp|gstreamer-video|gstreamer)
echo "--features=ser_de,v1_22"
echo "--features=serde,v1_22"
;;
gstreamer-validate)
echo ""

View file

@ -45,7 +45,7 @@ foreach($crate in $crates)
# Or when we want to build without default features
if ($env:LocalFeatures -and ($env:LocalFeatures -ne '--no-default-features')) {
if ($crate -eq 'gstreamer') {
$env:LocalFeatures += "ser_de,"
$env:LocalFeatures += "serde,"
}
if ($crate -eq 'examples') {

View file

@ -35,8 +35,8 @@ v1_16 = ["gst/v1_16", "gst-base/v1_16", "ffi/v1_16"]
v1_18 = ["gst/v1_18", "gst-base/v1_18", "ffi/v1_18", "v1_16"]
v1_20 = ["gst/v1_20", "gst-base/v1_20", "ffi/v1_20", "v1_18"]
v1_22 = ["gst/v1_22", "gst-base/v1_22", "ffi/v1_22", "v1_20"]
dox = ["v1_22", "ffi/dox", "glib/dox", "gst/dox", "gst-base/dox", "ser_de"]
ser_de = ["serde", "gst/ser_de"]
dox = ["v1_22", "ffi/dox", "glib/dox", "gst/dox", "gst-base/dox", "serde"]
serde = ["dep:serde", "gst/serde"]
[package.metadata.docs.rs]
features = ["dox"]

View file

@ -39,7 +39,7 @@ pub use crate::auto::*;
mod caps;
pub use crate::caps::AudioCapsBuilder;
#[cfg(feature = "ser_de")]
#[cfg(feature = "serde")]
mod flag_serde;
mod audio_format;

View file

@ -33,8 +33,8 @@ v1_16 = ["gst/v1_16", "gst-base/v1_16", "gst-pbutils/v1_16", "ffi/v1_16"]
v1_18 = ["gst/v1_18", "gst-base/v1_18", "gst-pbutils/v1_18", "ffi/v1_18", "v1_16"]
v1_20 = ["gst/v1_20", "gst-base/v1_20", "gst-pbutils/v1_20", "ffi/v1_20", "v1_18"]
v1_22 = ["gst/v1_22", "gst-base/v1_22", "gst-pbutils/v1_22", "ffi/v1_22", "v1_20"]
dox = ["v1_22", "ffi/dox", "glib/dox", "gio/dox", "gst/dox", "gst-base/dox", "gst-pbutils/dox", "ser_de"]
ser_de = ["serde", "gst/ser_de", "gst-pbutils/ser_de"]
dox = ["v1_22", "ffi/dox", "glib/dox", "gio/dox", "gst/dox", "gst-base/dox", "gst-pbutils/dox", "serde"]
serde = ["dep:serde", "gst/serde", "gst-pbutils/serde"]
[package.metadata.docs.rs]
features = ["dox"]

View file

@ -67,7 +67,7 @@ macro_rules! skip_assert_initialized {
mod auto;
pub use crate::auto::*;
#[cfg(feature = "ser_de")]
#[cfg(feature = "serde")]
mod flag_serde;
// Re-export all the traits in a prelude module, so that applications

View file

@ -38,8 +38,8 @@ v1_16 = ["gst/v1_16", "gst-base/v1_16", "gst-video/v1_16", "ffi/v1_16"]
v1_18 = ["gst/v1_18", "gst-base/v1_18", "gst-video/v1_18", "ffi/v1_18", "v1_16"]
v1_20 = ["gst/v1_20", "gst-base/v1_20", "gst-video/v1_20", "ffi/v1_20", "v1_18"]
v1_22 = ["gst/v1_22", "gst-base/v1_22", "gst-video/v1_22", "ffi/v1_22", "v1_20"]
dox = ["v1_22", "ffi/dox", "glib/dox", "gst/dox", "gst-base/dox", "gst-video/dox", "ser_de"]
ser_de = ["serde", "gst/ser_de", "gst-video/ser_de"]
dox = ["v1_22", "ffi/dox", "glib/dox", "gst/dox", "gst-base/dox", "gst-video/dox", "serde"]
serde = ["dep:serde", "gst/serde", "gst-video/serde"]
[package.metadata.docs.rs]
features = ["dox"]

View file

@ -37,7 +37,7 @@ mod auto;
pub use crate::auto::functions::*;
pub use crate::auto::*;
#[cfg(feature = "ser_de")]
#[cfg(feature = "serde")]
mod flag_serde;
mod caps_features;

View file

@ -34,8 +34,8 @@ v1_16 = ["gst/v1_16", "ffi/v1_16"]
v1_18 = ["gst/v1_18", "ffi/v1_18", "v1_16"]
v1_20 = ["gst/v1_20", "ffi/v1_20", "v1_18"]
v1_22 = ["gst/v1_22", "ffi/v1_22", "v1_20"]
dox = ["v1_22", "ffi/dox", "glib/dox", "gst/dox", "ser_de"]
ser_de = ["serde", "gst/ser_de"]
dox = ["v1_22", "ffi/dox", "glib/dox", "gst/dox", "serde"]
serde = ["dep:serde", "gst/serde"]
[package.metadata.docs.rs]
features = ["dox"]

View file

@ -43,7 +43,7 @@ mod auto;
pub use crate::auto::functions::*;
pub use crate::auto::*;
#[cfg(feature = "ser_de")]
#[cfg(feature = "serde")]
mod flag_serde;
mod discoverer;

View file

@ -32,8 +32,8 @@ v1_16 = ["gst/v1_16", "ffi/v1_16"]
v1_18 = ["gst/v1_18", "ffi/v1_18", "v1_16"]
v1_20 = ["gst/v1_20", "ffi/v1_20", "v1_18"]
v1_22 = ["gst/v1_22", "ffi/v1_22", "v1_20"]
dox = ["v1_22", "ffi/dox", "glib/dox", "gst/dox", "ser_de"]
ser_de = ["serde", "gst/ser_de"]
dox = ["v1_22", "ffi/dox", "glib/dox", "gst/dox", "serde"]
serde = ["dep:serde", "gst/serde"]
[package.metadata.docs.rs]
features = ["dox"]

View file

@ -37,7 +37,7 @@ mod auto;
pub use crate::auto::functions::*;
pub use crate::auto::*;
#[cfg(feature = "ser_de")]
#[cfg(feature = "serde")]
mod flag_serde;
pub mod subclass;

View file

@ -36,8 +36,8 @@ v1_16 = ["gst/v1_16", "gst-sdp/v1_16", "gst-rtsp/v1_16", "gst-net/v1_16", "ffi/v
v1_18 = ["gst/v1_18", "gst-sdp/v1_18", "gst-rtsp/v1_18", "gst-net/v1_18", "ffi/v1_18", "v1_16"]
v1_20 = ["gst/v1_20", "gst-sdp/v1_20", "gst-rtsp/v1_20", "gst-net/v1_20", "ffi/v1_20", "v1_18"]
v1_22 = ["gst/v1_22", "gst-sdp/v1_22", "gst-rtsp/v1_22", "gst-net/v1_22", "ffi/v1_22", "v1_20"]
dox = ["v1_22", "ffi/dox", "glib/dox", "gio/dox", "gst/dox", "gst-sdp/dox", "gst-rtsp/dox", "gst-net/dox", "ser_de"]
ser_de = ["serde", "gst/ser_de", "gst-rtsp/ser_de"]
dox = ["v1_22", "ffi/dox", "glib/dox", "gio/dox", "gst/dox", "gst-sdp/dox", "gst-rtsp/dox", "gst-net/dox", "serde"]
serde = ["dep:serde", "gst/serde", "gst-rtsp/serde"]
[package.metadata.docs.rs]
features = ["dox"]

View file

@ -40,7 +40,7 @@ macro_rules! skip_assert_initialized {
mod auto;
pub use crate::auto::*;
#[cfg(feature = "ser_de")]
#[cfg(feature = "serde")]
mod flag_serde;
mod rtsp_address_pool;

View file

@ -32,8 +32,8 @@ v1_16 = ["gst/v1_16", "gst-sdp/v1_16", "ffi/v1_16"]
v1_18 = ["gst/v1_18", "gst-sdp/v1_18", "ffi/v1_18", "v1_16"]
v1_20 = ["gst/v1_20", "gst-sdp/v1_20", "ffi/v1_20", "v1_18"]
v1_22 = ["gst/v1_22", "gst-sdp/v1_22", "ffi/v1_22", "v1_20"]
dox = ["v1_22", "ffi/dox", "glib/dox", "gst/dox", "gst-sdp/dox", "ser_de"]
ser_de = ["serde", "gst/ser_de"]
dox = ["v1_22", "ffi/dox", "glib/dox", "gst/dox", "gst-sdp/dox", "serde"]
serde = ["dep:serde", "gst/serde"]
[package.metadata.docs.rs]
features = ["dox"]

View file

@ -34,7 +34,7 @@ macro_rules! skip_assert_initialized {
mod auto;
pub use crate::auto::*;
#[cfg(feature = "ser_de")]
#[cfg(feature = "serde")]
mod flag_serde;
// Re-export all the traits in a prelude module, so that applications

View file

@ -36,8 +36,8 @@ v1_16 = ["gst/v1_16", "gst-base/v1_16", "ffi/v1_16"]
v1_18 = ["gst/v1_18", "gst-base/v1_18", "ffi/v1_18", "v1_16"]
v1_20 = ["gst/v1_20", "gst-base/v1_20", "ffi/v1_20", "v1_18"]
v1_22 = ["gst/v1_22", "gst-base/v1_22", "ffi/v1_22", "v1_20"]
dox = ["v1_22", "ffi/dox", "glib/dox", "gst/dox", "gst-base/dox", "ser_de"]
ser_de = ["serde", "gst/ser_de"]
dox = ["v1_22", "ffi/dox", "glib/dox", "gst/dox", "gst-base/dox", "serde"]
serde = ["dep:serde", "gst/serde"]
[package.metadata.docs.rs]
features = ["dox"]

View file

@ -287,7 +287,7 @@ name = "GstVideo.NavigationCommand"
status = "generate"
[[object.derive]]
name = "serde::Serialize, serde::Deserialize"
cfg_condition = "feature = \"ser_de\""
cfg_condition = "feature = \"serde\""
[[object.derive]]
name = "Debug, Eq, PartialEq, Ord, PartialOrd, Hash"

View file

@ -36,7 +36,7 @@ macro_rules! skip_assert_initialized {
mod auto;
pub use crate::auto::*;
#[cfg(feature = "ser_de")]
#[cfg(feature = "serde")]
mod flag_serde;
mod navigation;

View file

@ -601,8 +601,8 @@ nav_event_builder!(
);
const NAVIGATION_EVENT_NAME: &str = "application/x-gst-navigation";
#[cfg_attr(feature = "ser_de", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "ser_de", serde(tag = "event"))]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "event"))]
#[derive(Clone, PartialEq, Debug)]
pub enum NavigationEvent {
KeyPress {
@ -1266,7 +1266,7 @@ impl NavigationEvent {
#[cfg(test)]
mod tests {
#[test]
#[cfg(feature = "ser_de")]
#[cfg(feature = "serde")]
#[cfg(any(feature = "v1_22", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_22")))]
fn serialize_navigation_events() {

View file

@ -27,7 +27,7 @@ futures-channel = "0.3"
futures-util = { version = "0.3", default-features = false }
muldiv = "1"
opt-ops = { package = "option-operations", version = "0.5" }
serde = { version = "1.0", optional = true }
serde = { version = "1.0", optional = true, features = ["derive"] }
serde_bytes = { version = "0.11", optional = true }
paste = "1.0"
pretty-hex = "0.3"
@ -45,8 +45,8 @@ v1_16 = ["ffi/v1_16"]
v1_18 = ["ffi/v1_18", "v1_16"]
v1_20 = ["ffi/v1_20", "v1_18"]
v1_22 = ["ffi/v1_22", "v1_20"]
dox = ["v1_22", "ffi/dox", "glib/dox", "ser_de"]
ser_de = ["num-rational/serde", "serde", "serde_bytes", "serde/derive"]
dox = ["v1_22", "ffi/dox", "glib/dox", "serde"]
serde = ["num-rational/serde", "dep:serde", "serde_bytes"]
[package.metadata.docs.rs]
features = ["dox"]

View file

@ -1387,7 +1387,7 @@ name = "Gst.Format"
status = "generate"
[[object.derive]]
name = "serde::Serialize, serde::Deserialize"
cfg_condition = "feature = \"ser_de\""
cfg_condition = "feature = \"serde\""
[[object.derive]]
name = "Debug, PartialEq, Eq, PartialOrd, Ord, Hash"
[[object.function]]
@ -1748,7 +1748,7 @@ name = "Gst.PadDirection"
status = "generate"
[[object.derive]]
name = "serde::Serialize, serde::Deserialize"
cfg_condition = "feature = \"ser_de\""
cfg_condition = "feature = \"serde\""
[[object.derive]]
name = "Debug, PartialEq, Eq, PartialOrd, Ord, Hash"
@ -1780,7 +1780,7 @@ name = "Gst.PadPresence"
status = "generate"
[[object.derive]]
name = "serde::Serialize, serde::Deserialize"
cfg_condition = "feature = \"ser_de\""
cfg_condition = "feature = \"serde\""
[[object.derive]]
name = "Debug, PartialEq, Eq, PartialOrd, Ord, Hash"
@ -2032,7 +2032,7 @@ name = "Gst.Rank"
status = "generate"
[[object.derive]]
name = "serde::Serialize, serde::Deserialize"
cfg_condition = "feature = \"ser_de\""
cfg_condition = "feature = \"serde\""
[[object.derive]]
name = "Debug"
@ -2132,7 +2132,7 @@ name = "Gst.State"
status = "generate"
[[object.derive]]
name = "serde::Serialize, serde::Deserialize"
cfg_condition = "feature = \"ser_de\""
cfg_condition = "feature = \"serde\""
[[object.derive]]
name = "Debug, PartialEq, Eq, PartialOrd, Ord, Hash"
@ -2313,7 +2313,7 @@ name = "Gst.TagScope"
status = "generate"
[[object.derive]]
name = "serde::Serialize, serde::Deserialize"
cfg_condition = "feature = \"ser_de\""
cfg_condition = "feature = \"serde\""
[[object.derive]]
name = "Debug, PartialEq, Eq, PartialOrd, Ord, Hash"
@ -2408,7 +2408,7 @@ name = "Gst.TocEntryType"
status = "generate"
[[object.derive]]
name = "serde::Serialize, serde::Deserialize"
cfg_condition = "feature = \"ser_de\""
cfg_condition = "feature = \"serde\""
[[object.derive]]
name = "Debug, PartialEq, Eq, PartialOrd, Ord, Hash"
@ -2417,7 +2417,7 @@ name = "Gst.TocLoopType"
status = "generate"
[[object.derive]]
name = "serde::Serialize, serde::Deserialize"
cfg_condition = "feature = \"ser_de\""
cfg_condition = "feature = \"serde\""
[[object.derive]]
name = "Debug, PartialEq, Eq, PartialOrd, Ord, Hash"
@ -2426,7 +2426,7 @@ name = "Gst.TocScope"
status = "generate"
[[object.derive]]
name = "serde::Serialize, serde::Deserialize"
cfg_condition = "feature = \"ser_de\""
cfg_condition = "feature = \"serde\""
[[object.derive]]
name = "Debug, PartialEq, Eq, PartialOrd, Ord, Hash"
@ -2475,6 +2475,6 @@ name = "Gst.URIType"
status = "generate"
[[object.derive]]
name = "serde::Serialize, serde::Deserialize"
cfg_condition = "feature = \"ser_de\""
cfg_condition = "feature = \"serde\""
[[object.derive]]
name = "Debug, PartialEq, Eq, PartialOrd, Ord, Hash"

View file

@ -21,7 +21,7 @@ enum DateTimeVariants {
}
// Note: ser / de for `glib::Date` should be implemented in the `glib` crate
// However, there is no `ser_de` feature in `glib` right now. The limitation is that
// However, there is no `serde` feature in `glib` right now. The limitation is that
// `Date` fields can only be ser / de when they are used in `Value`s (which implies
// `Array`s, `List`s, `Structure` fields and `Tag`s)
pub(crate) struct Date(glib::Date);

View file

@ -88,7 +88,7 @@ impl<T> Signed<T> {
}
#[derive(PartialEq, Eq, Hash, Clone, Copy, Debug)]
#[cfg_attr(feature = "ser_de", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum GenericFormattedValue {
Undefined(Undefined),
Default(Option<Default>),

View file

@ -7,7 +7,7 @@ use crate::format::{Buffers, Bytes, Default, Percent, Undefined};
// Manual implementation for some types that would otherwise yield representations such as:
// "Default((Some(42)))"
macro_rules! impl_ser_de(
macro_rules! impl_serde(
($t:ident) => {
impl Serialize for $t {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
@ -25,9 +25,9 @@ macro_rules! impl_ser_de(
}
);
impl_ser_de!(Buffers);
impl_ser_de!(Bytes);
impl_ser_de!(Default);
impl_serde!(Buffers);
impl_serde!(Bytes);
impl_serde!(Default);
impl Serialize for Undefined {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {

View file

@ -50,9 +50,9 @@ pub use crate::auto::*;
mod macros;
#[macro_use]
#[cfg(feature = "ser_de")]
#[cfg(feature = "serde")]
mod serde_macros;
#[cfg(feature = "ser_de")]
#[cfg(feature = "serde")]
pub use crate::serde_macros::*;
#[macro_use]
@ -73,28 +73,28 @@ mod value;
pub use crate::value::{
Array, ArrayRef, Bitmask, Fraction, FractionRange, IntRange, List, ListRef,
};
#[cfg(feature = "ser_de")]
#[cfg(feature = "serde")]
#[macro_use]
mod value_serde;
#[cfg(feature = "ser_de")]
#[cfg(feature = "serde")]
mod flag_serde;
pub mod structure;
pub use crate::structure::{Structure, StructureRef};
#[cfg(feature = "ser_de")]
#[cfg(feature = "serde")]
mod structure_serde;
pub mod caps;
pub use crate::caps::{Caps, CapsFilterMapAction, CapsRef};
mod caps_features;
#[cfg(feature = "ser_de")]
#[cfg(feature = "serde")]
mod caps_serde;
pub use crate::caps_features::{
CapsFeatures, CapsFeaturesRef, CAPS_FEATURES_MEMORY_SYSTEM_MEMORY,
CAPS_FEATURE_MEMORY_SYSTEM_MEMORY,
};
#[cfg(feature = "ser_de")]
#[cfg(feature = "serde")]
mod caps_features_serde;
pub mod tags;
@ -102,7 +102,7 @@ pub use crate::tags::{
tag_exists, tag_get_description, tag_get_flag, tag_get_nick, tag_get_type, Tag, TagList,
TagListRef,
};
#[cfg(feature = "ser_de")]
#[cfg(feature = "serde")]
mod tags_serde;
pub mod meta;
@ -119,17 +119,17 @@ mod buffer_cursor;
pub use crate::buffer_cursor::{BufferCursor, BufferRefCursor};
pub mod memory;
pub use crate::memory::{MappedMemory, Memory, MemoryMap, MemoryRef};
#[cfg(feature = "ser_de")]
#[cfg(feature = "serde")]
mod buffer_serde;
pub mod sample;
pub use crate::sample::{Sample, SampleRef};
#[cfg(feature = "ser_de")]
#[cfg(feature = "serde")]
mod sample_serde;
pub mod bufferlist;
pub use crate::bufferlist::{BufferList, BufferListRef};
#[cfg(feature = "ser_de")]
#[cfg(feature = "serde")]
mod bufferlist_serde;
pub mod query;
@ -171,10 +171,10 @@ mod bus_windows;
mod child_proxy;
mod clock_time;
#[cfg(feature = "ser_de")]
#[cfg(feature = "serde")]
mod clock_time_serde;
mod date_time;
#[cfg(feature = "ser_de")]
#[cfg(feature = "serde")]
mod date_time_serde;
mod device_monitor;
mod device_provider;
@ -230,17 +230,17 @@ pub use crate::format::{
GenericFormattedValue, Signed, SpecificFormattedValue, SpecificFormattedValueFullRange,
SpecificFormattedValueIntrinsic,
};
#[cfg(feature = "ser_de")]
#[cfg(feature = "serde")]
mod format_serde;
mod segment;
pub use crate::segment::*;
#[cfg(feature = "ser_de")]
#[cfg(feature = "serde")]
mod segment_serde;
pub mod toc;
pub use crate::toc::{Toc, TocEntry, TocEntryRef, TocRef};
#[cfg(feature = "ser_de")]
#[cfg(feature = "serde")]
mod toc_serde;
mod clock;

View file

@ -282,7 +282,7 @@ impl glib::value::ToValue for Fraction {
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
#[cfg_attr(feature = "ser_de", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct IntRange<T> {
min: T,
max: T,
@ -466,7 +466,7 @@ impl glib::value::ToValue for IntRange<i64> {
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
#[cfg_attr(feature = "ser_de", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct FractionRange {
min: Fraction,
max: Fraction,
@ -549,7 +549,7 @@ impl glib::value::ToValue for FractionRange {
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
#[cfg_attr(feature = "ser_de", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Bitmask(pub u64);
impl Bitmask {