From 94ba143c742428a7a2630816e0372337060780db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 21 Nov 2017 16:14:39 +0200 Subject: [PATCH] Allow anything that implements Into> to be used for creating new pads --- gstreamer/src/pad.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gstreamer/src/pad.rs b/gstreamer/src/pad.rs index 3cdcce13b..133efe579 100644 --- a/gstreamer/src/pad.rs +++ b/gstreamer/src/pad.rs @@ -38,8 +38,12 @@ use libc; use ffi; impl Pad { - pub fn new_from_static_template(templ: &StaticPadTemplate, name: &str) -> Pad { + pub fn new_from_static_template<'a, P: Into>>( + templ: &StaticPadTemplate, + name: P, + ) -> Pad { assert_initialized_main_thread!(); + let name = name.into(); unsafe { from_glib_none(ffi::gst_pad_new_from_static_template( mut_override(templ.to_glib_none().0),