From 79c457c8c4800f7815801a519f3bac317113616d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 22 Jun 2020 11:26:24 +0300 Subject: [PATCH] gstreamer/pad: Rename Pad::builder_from_template() to builder_with_template() Sounds more natural as it creates a build that is initialized *with* a template. But keep Pad::from_template() as it creates a new pad *from* a template. --- gstreamer/src/pad.rs | 16 ++++++++-------- gstreamer/src/subclass/element.rs | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/gstreamer/src/pad.rs b/gstreamer/src/pad.rs index 53ff16bd2..8515b1e96 100644 --- a/gstreamer/src/pad.rs +++ b/gstreamer/src/pad.rs @@ -1558,10 +1558,10 @@ impl Pad { pub fn from_static_template(templ: &StaticPadTemplate, name: Option<&str>) -> Self { skip_assert_initialized!(); - Self::builder_from_static_template(templ, name).build() + Self::builder_with_static_template(templ, name).build() } - pub fn builder_from_static_template( + pub fn builder_with_static_template( templ: &StaticPadTemplate, name: Option<&str>, ) -> PadBuilder { @@ -1571,10 +1571,10 @@ impl Pad { pub fn from_template(templ: &::PadTemplate, name: Option<&str>) -> Self { skip_assert_initialized!(); - Self::builder_from_template(templ, name).build() + Self::builder_with_template(templ, name).build() } - pub fn builder_from_template(templ: &::PadTemplate, name: Option<&str>) -> PadBuilder { + pub fn builder_with_template(templ: &::PadTemplate, name: Option<&str>) -> PadBuilder { skip_assert_initialized!(); PadBuilder::from_template(templ, name) } @@ -1593,10 +1593,10 @@ impl ::GhostPad { pub fn from_static_template(templ: &StaticPadTemplate, name: Option<&str>) -> Self { skip_assert_initialized!(); - Self::builder_from_static_template(templ, name).build() + Self::builder_with_static_template(templ, name).build() } - pub fn builder_from_static_template( + pub fn builder_with_static_template( templ: &StaticPadTemplate, name: Option<&str>, ) -> PadBuilder { @@ -1606,10 +1606,10 @@ impl ::GhostPad { pub fn from_template(templ: &::PadTemplate, name: Option<&str>) -> Self { skip_assert_initialized!(); - Self::builder_from_template(templ, name).build() + Self::builder_with_template(templ, name).build() } - pub fn builder_from_template(templ: &::PadTemplate, name: Option<&str>) -> PadBuilder { + pub fn builder_with_template(templ: &::PadTemplate, name: Option<&str>) -> PadBuilder { skip_assert_initialized!(); PadBuilder::from_template(templ, name) } diff --git a/gstreamer/src/subclass/element.rs b/gstreamer/src/subclass/element.rs index 0d0610fd6..fbb5d5250 100644 --- a/gstreamer/src/subclass/element.rs +++ b/gstreamer/src/subclass/element.rs @@ -570,7 +570,7 @@ mod tests { fn with_class(klass: &subclass::simple::ClassStruct) -> Self { let templ = klass.get_pad_template("sink").unwrap(); - let sinkpad = ::Pad::builder_from_template(&templ, Some("sink")) + let sinkpad = ::Pad::builder_with_template(&templ, Some("sink")) .chain_function(|pad, parent, buffer| { TestElement::catch_panic_pad_function( parent, @@ -595,7 +595,7 @@ mod tests { .build(); let templ = klass.get_pad_template("src").unwrap(); - let srcpad = ::Pad::builder_from_template(&templ, Some("src")) + let srcpad = ::Pad::builder_with_template(&templ, Some("src")) .event_function(|pad, parent, event| { TestElement::catch_panic_pad_function( parent,