mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-26 11:31:06 +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> {
|
impl<T: AsMutPtr> Uri<T> {
|
||||||
#[doc(alias = "gst_query_set_uri")]
|
#[doc(alias = "gst_query_set_uri")]
|
||||||
pub fn set_uri<'b, U: Into<&'b str>>(&mut self, uri: U) {
|
pub fn set_uri(&mut self, uri: &str) {
|
||||||
let uri = uri.into();
|
|
||||||
unsafe {
|
unsafe {
|
||||||
ffi::gst_query_set_uri(self.0.as_mut_ptr(), uri.to_glib_none().0);
|
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) {
|
pub fn set_redirection(&mut self, uri: &str, permanent: bool) {
|
||||||
let uri = uri.into();
|
|
||||||
unsafe {
|
unsafe {
|
||||||
ffi::gst_query_set_uri_redirection(self.0.as_mut_ptr(), uri.to_glib_none().0);
|
ffi::gst_query_set_uri_redirection(self.0.as_mut_ptr(), uri.to_glib_none().0);
|
||||||
ffi::gst_query_set_uri_redirection_permanent(
|
ffi::gst_query_set_uri_redirection_permanent(
|
||||||
|
|
|
@ -852,15 +852,12 @@ pub trait GstValueExt: Sized {
|
||||||
#[doc(alias = "gst_value_serialize")]
|
#[doc(alias = "gst_value_serialize")]
|
||||||
fn serialize(&self) -> Result<glib::GString, glib::BoolError>;
|
fn serialize(&self) -> Result<glib::GString, glib::BoolError>;
|
||||||
#[doc(alias = "gst_value_deserialize")]
|
#[doc(alias = "gst_value_deserialize")]
|
||||||
fn deserialize<'a, T: Into<&'a str>>(
|
fn deserialize(s: &str, type_: glib::Type) -> Result<glib::Value, glib::BoolError>;
|
||||||
s: T,
|
|
||||||
type_: glib::Type,
|
|
||||||
) -> Result<glib::Value, glib::BoolError>;
|
|
||||||
#[cfg(any(feature = "v1_20", feature = "dox"))]
|
#[cfg(any(feature = "v1_20", feature = "dox"))]
|
||||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
|
||||||
#[doc(alias = "gst_value_deserialize_with_pspec")]
|
#[doc(alias = "gst_value_deserialize_with_pspec")]
|
||||||
fn deserialize_with_pspec<'a, T: Into<&'a str>>(
|
fn deserialize_with_pspec(
|
||||||
s: T,
|
s: &str,
|
||||||
pspec: &glib::ParamSpec,
|
pspec: &glib::ParamSpec,
|
||||||
) -> Result<glib::Value, glib::BoolError>;
|
) -> Result<glib::Value, glib::BoolError>;
|
||||||
}
|
}
|
||||||
|
@ -1002,14 +999,9 @@ impl GstValueExt for glib::Value {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn deserialize<'a, T: Into<&'a str>>(
|
fn deserialize(s: &str, type_: glib::Type) -> Result<glib::Value, glib::BoolError> {
|
||||||
s: T,
|
|
||||||
type_: glib::Type,
|
|
||||||
) -> Result<glib::Value, glib::BoolError> {
|
|
||||||
assert_initialized_main_thread!();
|
assert_initialized_main_thread!();
|
||||||
|
|
||||||
let s = s.into();
|
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
let mut value = glib::Value::from_type(type_);
|
let mut value = glib::Value::from_type(type_);
|
||||||
let ret: bool = from_glib(ffi::gst_value_deserialize(
|
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(any(feature = "v1_20", feature = "dox"))]
|
||||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
|
||||||
fn deserialize_with_pspec<'a, T: Into<&'a str>>(
|
fn deserialize_with_pspec(
|
||||||
s: T,
|
s: &str,
|
||||||
pspec: &glib::ParamSpec,
|
pspec: &glib::ParamSpec,
|
||||||
) -> Result<glib::Value, glib::BoolError> {
|
) -> Result<glib::Value, glib::BoolError> {
|
||||||
assert_initialized_main_thread!();
|
assert_initialized_main_thread!();
|
||||||
|
|
||||||
let s = s.into();
|
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
let mut value = glib::Value::from_type(pspec.value_type());
|
let mut value = glib::Value::from_type(pspec.value_type());
|
||||||
let ret: bool = from_glib(ffi::gst_value_deserialize_with_pspec(
|
let ret: bool = from_glib(ffi::gst_value_deserialize_with_pspec(
|
||||||
|
|
Loading…
Reference in a new issue