From 7bc1fce97d0a4b24339f735890f08d7a6598091b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sat, 16 Dec 2017 18:10:10 +0200 Subject: [PATCH] Move value for PropertyNotification message into the builder instead of constructor --- gstreamer/src/message.rs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/gstreamer/src/message.rs b/gstreamer/src/message.rs index 7b155b53d..5523797ed 100644 --- a/gstreamer/src/message.rs +++ b/gstreamer/src/message.rs @@ -319,12 +319,9 @@ impl GstRc { } #[cfg(any(feature = "v1_10", feature = "dox"))] - pub fn new_property_notify<'a, V: Into>>( - property_name: &'a str, - value: V, - ) -> PropertyNotifyBuilder<'a> { + pub fn new_property_notify<'a>(property_name: &'a str) -> PropertyNotifyBuilder<'a> { assert_initialized_main_thread!(); - PropertyNotifyBuilder::new(property_name, value.into()) + PropertyNotifyBuilder::new(property_name) } #[cfg(any(feature = "v1_10", feature = "dox"))] @@ -2291,14 +2288,21 @@ pub struct PropertyNotifyBuilder<'a> { } #[cfg(any(feature = "v1_10", feature = "dox"))] impl<'a> PropertyNotifyBuilder<'a> { - fn new(property_name: &'a str, value: Option<&'a glib::ToSendValue>) -> Self { + fn new(property_name: &'a str) -> Self { skip_assert_initialized!(); Self { src: None, seqnum: None, other_fields: Vec::new(), property_name: property_name, - value: value, + value: None, + } + } + + pub fn value(self, value: &'a glib::ToSendValue) -> Self { + Self { + value: Some(value), + ..self } }