mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-22 17:41:05 +00:00
gstreamer: Use plain &str for parameters instead of Into<&str>
The latter doesn't really have any advantage and only bloats the API.
This commit is contained in:
parent
82b7239379
commit
30bb699cbc
2 changed files with 8 additions and 20 deletions
|
@ -894,15 +894,13 @@ impl<T: AsPtr> Uri<T> {
|
|||
|
||||
impl<T: AsMutPtr> Uri<T> {
|
||||
#[doc(alias = "gst_query_set_uri")]
|
||||
pub fn set_uri<'b, U: Into<&'b str>>(&mut self, uri: U) {
|
||||
let uri = uri.into();
|
||||
pub fn set_uri(&mut self, uri: &str) {
|
||||
unsafe {
|
||||
ffi::gst_query_set_uri(self.0.as_mut_ptr(), uri.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_redirection<'b, U: Into<&'b str>>(&mut self, uri: U, permanent: bool) {
|
||||
let uri = uri.into();
|
||||
pub fn set_redirection(&mut self, uri: &str, permanent: bool) {
|
||||
unsafe {
|
||||
ffi::gst_query_set_uri_redirection(self.0.as_mut_ptr(), uri.to_glib_none().0);
|
||||
ffi::gst_query_set_uri_redirection_permanent(
|
||||
|
|
|
@ -852,15 +852,12 @@ pub trait GstValueExt: Sized {
|
|||
#[doc(alias = "gst_value_serialize")]
|
||||
fn serialize(&self) -> Result<glib::GString, glib::BoolError>;
|
||||
#[doc(alias = "gst_value_deserialize")]
|
||||
fn deserialize<'a, T: Into<&'a str>>(
|
||||
s: T,
|
||||
type_: glib::Type,
|
||||
) -> Result<glib::Value, glib::BoolError>;
|
||||
fn deserialize(s: &str, type_: glib::Type) -> Result<glib::Value, glib::BoolError>;
|
||||
#[cfg(any(feature = "v1_20", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
|
||||
#[doc(alias = "gst_value_deserialize_with_pspec")]
|
||||
fn deserialize_with_pspec<'a, T: Into<&'a str>>(
|
||||
s: T,
|
||||
fn deserialize_with_pspec(
|
||||
s: &str,
|
||||
pspec: &glib::ParamSpec,
|
||||
) -> Result<glib::Value, glib::BoolError>;
|
||||
}
|
||||
|
@ -1002,14 +999,9 @@ impl GstValueExt for glib::Value {
|
|||
}
|
||||
}
|
||||
|
||||
fn deserialize<'a, T: Into<&'a str>>(
|
||||
s: T,
|
||||
type_: glib::Type,
|
||||
) -> Result<glib::Value, glib::BoolError> {
|
||||
fn deserialize(s: &str, type_: glib::Type) -> Result<glib::Value, glib::BoolError> {
|
||||
assert_initialized_main_thread!();
|
||||
|
||||
let s = s.into();
|
||||
|
||||
unsafe {
|
||||
let mut value = glib::Value::from_type(type_);
|
||||
let ret: bool = from_glib(ffi::gst_value_deserialize(
|
||||
|
@ -1026,14 +1018,12 @@ impl GstValueExt for glib::Value {
|
|||
|
||||
#[cfg(any(feature = "v1_20", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
|
||||
fn deserialize_with_pspec<'a, T: Into<&'a str>>(
|
||||
s: T,
|
||||
fn deserialize_with_pspec(
|
||||
s: &str,
|
||||
pspec: &glib::ParamSpec,
|
||||
) -> Result<glib::Value, glib::BoolError> {
|
||||
assert_initialized_main_thread!();
|
||||
|
||||
let s = s.into();
|
||||
|
||||
unsafe {
|
||||
let mut value = glib::Value::from_type(pspec.value_type());
|
||||
let ret: bool = from_glib(ffi::gst_value_deserialize_with_pspec(
|
||||
|
|
Loading…
Reference in a new issue