Remove deprecated API

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1513>
This commit is contained in:
Sebastian Dröge 2024-08-28 09:35:06 +03:00
parent 497f15acd3
commit ed6aac91bd
6 changed files with 2 additions and 352 deletions

View file

@ -139,18 +139,6 @@ macro_rules! message_builder_generic_impl {
gst::impl_builder_gvalue_extra_setters!(other_field);
#[deprecated = "use builder.other_field() instead"]
#[allow(clippy::needless_update)]
pub fn other_fields(
self,
other_fields: &[(&'a str, &'a (dyn ToSendValue + Sync))],
) -> Self {
Self {
builder: self.builder.other_fields(other_fields),
..self
}
}
#[must_use = "Building the message without using it has no effect"]
#[allow(clippy::redundant_closure_call)]
pub fn build(mut self) -> Message {
@ -239,16 +227,6 @@ impl<'a> MessageBuilder<'a> {
..self
}
}
fn other_fields(self, other_fields: &[(&'a str, &'a (dyn ToSendValue + Sync))]) -> Self {
let mut s = self;
for (name, value) in other_fields {
s = s.other_field(name, value.to_send_value());
}
s
}
}
enum MessageBuilderDetail<'a> {

View file

@ -70,20 +70,6 @@ macro_rules! event_builder_generic_impl {
gst::impl_builder_gvalue_extra_setters!(other_field);
#[deprecated = "use build.other_field() instead"]
pub fn other_fields(
self,
other_fields: &[(&'a str, &'a (dyn ToSendValue + Sync))],
) -> Self {
let mut s = self;
for (name, value) in other_fields {
s = s.other_field(name, value.to_send_value());
}
s
}
#[must_use = "Building the event without using it has no effect"]
#[allow(clippy::redundant_closure_call)]
pub fn build(mut self) -> gst::Event {

View file

@ -76,18 +76,6 @@ macro_rules! message_builder_generic_impl {
gst::impl_builder_gvalue_extra_setters!(other_field);
#[deprecated = "use builder.other_field() instead"]
#[allow(clippy::needless_update)]
pub fn other_fields(
self,
other_fields: &[(&'a str, &'a (dyn ToSendValue + Sync))],
) -> Self {
Self {
builder: self.builder.other_fields(other_fields),
..self
}
}
#[must_use = "Building the message without using it has no effect"]
#[allow(clippy::redundant_closure_call)]
pub fn build(mut self) -> Message {
@ -157,16 +145,6 @@ impl<'a> MessageBuilder<'a> {
..self
}
}
fn other_fields(self, other_fields: &[(&'a str, &'a (dyn ToSendValue + Sync))]) -> Self {
let mut s = self;
for (name, value) in other_fields {
s = s.other_field(name, value.to_send_value());
}
s
}
}
#[must_use = "The builder must be built to be used"]

View file

@ -2076,16 +2076,6 @@ impl<'a> EventBuilder<'a> {
..self
}
}
fn other_fields(self, other_fields: &[(&'a str, &'a (dyn ToSendValue + Sync))]) -> Self {
let mut s = self;
for (name, value) in other_fields {
s = s.other_field(name, value.to_send_value());
}
s
}
}
macro_rules! event_builder_generic_impl {
@ -2162,18 +2152,6 @@ macro_rules! event_builder_generic_impl {
impl_builder_gvalue_extra_setters!(other_field);
#[deprecated = "use build.other_field() instead"]
#[allow(clippy::needless_update)]
pub fn other_fields(
self,
other_fields: &[(&'a str, &'a (dyn ToSendValue + Sync))],
) -> Self {
Self {
builder: self.builder.other_fields(other_fields),
..self
}
}
#[must_use = "Building the event without using it has no effect"]
#[allow(clippy::redundant_closure_call)]
pub fn build(mut self) -> Event {
@ -3142,7 +3120,7 @@ mod tests {
}
let flush_start_evt = FlushStart::builder()
.other_fields(&[("extra-field", &true)])
.other_field("extra-field", true)
.build();
match flush_start_evt.view() {
EventView::FlushStart(flush_start_evt) => {

View file

@ -622,37 +622,6 @@ macro_rules! error(
($cat:expr, id = $id:expr, $($args:tt)*) => { {
$crate::log_with_level!($cat, $crate::DebugLevel::Error, id = $id, $($args)*)
}};
($cat:expr, obj: $obj:expr, $($args:tt)*) => { {
{
#[deprecated = "Using old-style obj format. Use `obj = ` instead of `obj: ` for better tooling support"]
macro_rules! error(
() => {}
);
error!();
}
$crate::log_with_level!($cat, $crate::DebugLevel::Error, obj = $obj, $($args)*)
}};
($cat:expr, imp: $imp:expr, $($args:tt)*) => { {
{
#[deprecated = "Using old-style imp format. Use `imp = ` instead of `imp: ` for better tooling support"]
macro_rules! error(
() => {}
);
error!();
}
$crate::log_with_level!($cat, $crate::DebugLevel::Error, imp = $imp, $($args)*)
}};
($cat:expr, id: $id:expr, $($args:tt)*) => { {
{
#[deprecated = "Using old-style id format. Use `id = ` instead of `id: ` for better tooling support"]
macro_rules! error(
() => {}
);
error!();
}
$crate::log_with_level!($cat, $crate::DebugLevel::Error, id = $id, $($args)*)
}};
($cat:expr, $($args:tt)*) => { {
$crate::log_with_level!($cat, $crate::DebugLevel::Error, $($args)*)
}};
@ -669,37 +638,6 @@ macro_rules! warning(
($cat:expr, id = $id:expr, $($args:tt)*) => { {
$crate::log_with_level!($cat, $crate::DebugLevel::Warning, id = $id, $($args)*)
}};
($cat:expr, obj: $obj:expr, $($args:tt)*) => { {
{
#[deprecated = "Using old-style obj format. Use `obj = ` instead of `obj: ` for better tooling support"]
macro_rules! warning(
() => {}
);
warning!();
}
$crate::log_with_level!($cat, $crate::DebugLevel::Warning, obj = $obj, $($args)*)
}};
($cat:expr, imp: $imp:expr, $($args:tt)*) => { {
{
#[deprecated = "Using old-style imp format. Use `imp = ` instead of `imp: ` for better tooling support"]
macro_rules! warning(
() => {}
);
warning!();
}
$crate::log_with_level!($cat, $crate::DebugLevel::Warning, imp = $imp, $($args)*)
}};
($cat:expr, id: $id:expr, $($args:tt)*) => { {
{
#[deprecated = "Using old-style id format. Use `id = ` instead of `id: ` for better tooling support"]
macro_rules! warning(
() => {}
);
warning!();
}
$crate::log_with_level!($cat, $crate::DebugLevel::Warning, id = $id, $($args)*)
}};
($cat:expr, $($args:tt)*) => { {
$crate::log_with_level!($cat, $crate::DebugLevel::Warning, $($args)*)
}};
@ -716,37 +654,6 @@ macro_rules! fixme(
($cat:expr, id = $id:expr, $($args:tt)*) => { {
$crate::log_with_level!($cat, $crate::DebugLevel::Fixme, id = $id, $($args)*)
}};
($cat:expr, obj: $obj:expr, $($args:tt)*) => { {
{
#[deprecated = "Using old-style obj format. Use `obj = ` instead of `obj: ` for better tooling support"]
macro_rules! fixme(
() => {}
);
fixme!();
}
$crate::log_with_level!($cat, $crate::DebugLevel::Fixme, obj = $obj, $($args)*)
}};
($cat:expr, imp: $imp:expr, $($args:tt)*) => { {
{
#[deprecated = "Using old-style imp format. Use `imp = ` instead of `imp: ` for better tooling support"]
macro_rules! fixme(
() => {}
);
fixme!();
}
$crate::log_with_level!($cat, $crate::DebugLevel::Fixme, imp = $imp, $($args)*)
}};
($cat:expr, id: $id:expr, $($args:tt)*) => { {
{
#[deprecated = "Using old-style id format. Use `id = ` instead of `id: ` for better tooling support"]
macro_rules! fixme(
() => {}
);
fixme!();
}
$crate::log_with_level!($cat, $crate::DebugLevel::Fixme, id = $id, $($args)*)
}};
($cat:expr, $($args:tt)*) => { {
$crate::log_with_level!($cat, $crate::DebugLevel::Fixme, $($args)*)
}};
@ -763,37 +670,6 @@ macro_rules! info(
($cat:expr, id = $id:expr, $($args:tt)*) => { {
$crate::log_with_level!($cat, $crate::DebugLevel::Info, id = $id, $($args)*)
}};
($cat:expr, obj: $obj:expr, $($args:tt)*) => { {
{
#[deprecated = "Using old-style obj format. Use `obj = ` instead of `obj: ` for better tooling support"]
macro_rules! info(
() => {}
);
info!();
}
$crate::log_with_level!($cat, $crate::DebugLevel::Info, obj = $obj, $($args)*)
}};
($cat:expr, imp: $imp:expr, $($args:tt)*) => { {
{
#[deprecated = "Using old-style imp format. Use `imp = ` instead of `imp: ` for better tooling support"]
macro_rules! info(
() => {}
);
info!();
}
$crate::log_with_level!($cat, $crate::DebugLevel::Info, imp = $imp, $($args)*)
}};
($cat:expr, id: $id:expr, $($args:tt)*) => { {
{
#[deprecated = "Using old-style id format. Use `id = ` instead of `id: ` for better tooling support"]
macro_rules! info(
() => {}
);
info!();
}
$crate::log_with_level!($cat, $crate::DebugLevel::Info, id = $id, $($args)*)
}};
($cat:expr, $($args:tt)*) => { {
$crate::log_with_level!($cat, $crate::DebugLevel::Info, $($args)*)
}};
@ -810,37 +686,6 @@ macro_rules! debug(
($cat:expr, id = $id:expr, $($args:tt)*) => { {
$crate::log_with_level!($cat, $crate::DebugLevel::Debug, id = $id, $($args)*)
}};
($cat:expr, obj: $obj:expr, $($args:tt)*) => { {
{
#[deprecated = "Using old-style obj format. Use `obj = ` instead of `obj: ` for better tooling support"]
macro_rules! debug(
() => {}
);
debug!();
}
$crate::log_with_level!($cat, $crate::DebugLevel::Debug, obj = $obj, $($args)*)
}};
($cat:expr, imp: $imp:expr, $($args:tt)*) => { {
{
#[deprecated = "Using old-style imp format. Use `imp = ` instead of `imp: ` for better tooling support"]
macro_rules! debug(
() => {}
);
debug!();
}
$crate::log_with_level!($cat, $crate::DebugLevel::Debug, imp = $imp, $($args)*)
}};
($cat:expr, id: $id:expr, $($args:tt)*) => { {
{
#[deprecated = "Using old-style id format. Use `id = ` instead of `id: ` for better tooling support"]
macro_rules! debug(
() => {}
);
debug!();
}
$crate::log_with_level!($cat, $crate::DebugLevel::Debug, id = $id, $($args)*)
}};
($cat:expr, $($args:tt)*) => { {
$crate::log_with_level!($cat, $crate::DebugLevel::Debug, $($args)*)
}};
@ -857,37 +702,6 @@ macro_rules! log(
($cat:expr, id = $id:expr, $($args:tt)*) => { {
$crate::log_with_level!($cat, $crate::DebugLevel::Log, id = $id, $($args)*)
}};
($cat:expr, obj: $obj:expr, $($args:tt)*) => { {
{
#[deprecated = "Using old-style obj format. Use `obj = ` instead of `obj: ` for better tooling support"]
macro_rules! log(
() => {}
);
log!();
}
$crate::log_with_level!($cat, $crate::DebugLevel::Log, obj = $obj, $($args)*)
}};
($cat:expr, imp: $imp:expr, $($args:tt)*) => { {
{
#[deprecated = "Using old-style imp format. Use `imp = ` instead of `imp: ` for better tooling support"]
macro_rules! log(
() => {}
);
log!();
}
$crate::log_with_level!($cat, $crate::DebugLevel::Log, imp = $imp, $($args)*)
}};
($cat:expr, id: $id:expr, $($args:tt)*) => { {
{
#[deprecated = "Using old-style id format. Use `id = ` instead of `id: ` for better tooling support"]
macro_rules! log(
() => {}
);
log!();
}
$crate::log_with_level!($cat, $crate::DebugLevel::Log, id = $id, $($args)*)
}};
($cat:expr, $($args:tt)*) => { {
$crate::log_with_level!($cat, $crate::DebugLevel::Log, $($args)*)
}};
@ -904,37 +718,6 @@ macro_rules! trace(
($cat:expr, id = $id:expr, $($args:tt)*) => { {
$crate::log_with_level!($cat, $crate::DebugLevel::Trace, id = $id, $($args)*)
}};
($cat:expr, obj: $obj:expr, $($args:tt)*) => { {
{
#[deprecated = "Using old-style obj format. Use `obj = ` instead of `obj: ` for better tooling support"]
macro_rules! trace(
() => {}
);
trace!();
}
$crate::log_with_level!($cat, $crate::DebugLevel::Trace, obj = $obj, $($args)*)
}};
($cat:expr, imp: $imp:expr, $($args:tt)*) => { {
{
#[deprecated = "Using old-style imp format. Use `imp = ` instead of `imp: ` for better tooling support"]
macro_rules! trace(
() => {}
);
trace!();
}
$crate::log_with_level!($cat, $crate::DebugLevel::Trace, imp = $imp, $($args)*)
}};
($cat:expr, id: $id:expr, $($args:tt)*) => { {
{
#[deprecated = "Using old-style id format. Use `id = ` instead of `id: `"]
macro_rules! trace(
() => {}
);
trace!();
}
$crate::log_with_level!($cat, $crate::DebugLevel::Trace, id = $id, $($args)*)
}};
($cat:expr, $($args:tt)*) => { {
$crate::log_with_level!($cat, $crate::DebugLevel::Trace, $($args)*)
}};
@ -951,37 +734,6 @@ macro_rules! memdump(
($cat:expr, id = $id:expr, $($args:tt)*) => { {
$crate::log_with_level!($cat, $crate::DebugLevel::Memdump, id = $id, $($args)*)
}};
($cat:expr, obj: $obj:expr, $($args:tt)*) => { {
{
#[deprecated = "Using old-style obj format. Use `obj = ` instead of `obj: ` for better tooling support"]
macro_rules! memdump(
() => {}
);
memdump!();
}
$crate::log_with_level!($cat, $crate::DebugLevel::Memdump, obj = $obj, $($args)*)
}};
($cat:expr, imp: $imp:expr, $($args:tt)*) => { {
{
#[deprecated = "Using old-style imp format. Use `imp = ` instead of `imp: ` for better tooling support"]
macro_rules! memdump(
() => {}
);
memdump!();
}
$crate::log_with_level!($cat, $crate::DebugLevel::Memdump, imp = $imp, $($args)*)
}};
($cat:expr, id: $id:expr, $($args:tt)*) => { {
{
#[deprecated = "Using old-style id format. Use `id = ` instead of `id: ` for better tooling support"]
macro_rules! memdump(
() => {}
);
memdump!();
}
$crate::log_with_level!($cat, $crate::DebugLevel::Memdump, id = $id, $($args)*)
}};
($cat:expr, $($args:tt)*) => { {
$crate::log_with_level!($cat, $crate::DebugLevel::Memdump, $($args)*)
}};

View file

@ -2594,16 +2594,6 @@ impl<'a> MessageBuilder<'a> {
..self
}
}
fn other_fields(self, other_fields: &[(&'a str, &'a (dyn ToSendValue + Sync))]) -> Self {
let mut s = self;
for (name, value) in other_fields {
s = s.other_field(name, value.to_send_value());
}
s
}
}
macro_rules! message_builder_generic_impl {
@ -2712,18 +2702,6 @@ macro_rules! message_builder_generic_impl {
impl_builder_gvalue_extra_setters!(other_field);
#[deprecated = "use build.other_field() instead"]
#[allow(clippy::needless_update)]
pub fn other_fields(
self,
other_fields: &[(&'a str, &'a (dyn ToSendValue + Sync))],
) -> Self {
Self {
builder: self.builder.other_fields(other_fields),
..self
}
}
#[must_use = "Building the message without using it has no effect"]
#[allow(clippy::redundant_closure_call)]
pub fn build(mut self) -> Message {
@ -4325,7 +4303,7 @@ mod tests {
let seqnum = Seqnum::next();
let eos_msg = Eos::builder()
.other_fields(&[("extra-field", &true)])
.other_field("extra-field", true)
.seqnum(seqnum)
.build();
match eos_msg.view() {