@@ -1608,13 +1608,13 @@ impl<'a, O: IsA<Object> + IsClass> ObjectBuilder<'a, O> {
1608
1608
1609
1609
// rustdoc-stripper-ignore-next
1610
1610
/// Set property `name` to the given value `value`.
1611
- pub fn property < T : ToValue + ' a > ( self , name : & ' a str , value : T ) -> Self {
1611
+ pub fn property ( self , name : & ' a str , value : impl Into < Value > ) -> Self {
1612
1612
let ObjectBuilder {
1613
1613
type_,
1614
1614
mut properties,
1615
1615
..
1616
1616
} = self ;
1617
- properties. push ( ( name, value. to_value ( ) ) ) ;
1617
+ properties. push ( ( name, value. into ( ) ) ) ;
1618
1618
1619
1619
ObjectBuilder {
1620
1620
type_,
@@ -1692,7 +1692,7 @@ pub trait ObjectExt: ObjectType {
1692
1692
/// If the property does not exist, if the type of the property is different than
1693
1693
/// the provided value, or if the property is not writable.
1694
1694
#[ doc( alias = "g_object_set_property" ) ]
1695
- fn set_property < V : ToValue > ( & self , property_name : & str , value : V ) ;
1695
+ fn set_property ( & self , property_name : & str , value : impl Into < Value > ) ;
1696
1696
1697
1697
// rustdoc-stripper-ignore-next
1698
1698
/// Sets the property `property_name` of the object to value `value`.
@@ -2298,15 +2298,15 @@ impl<T: ObjectType> ObjectExt for T {
2298
2298
}
2299
2299
2300
2300
#[ track_caller]
2301
- fn set_property < V : ToValue > ( & self , property_name : & str , value : V ) {
2301
+ fn set_property ( & self , property_name : & str , value : impl Into < Value > ) {
2302
2302
let pspec = self . find_property ( property_name) . unwrap_or_else ( || {
2303
2303
panic ! (
2304
2304
"property '{property_name}' of type '{}' not found" ,
2305
2305
self . type_( )
2306
2306
)
2307
2307
} ) ;
2308
2308
2309
- let mut property_value = value. to_value ( ) ;
2309
+ let mut property_value = value. into ( ) ;
2310
2310
validate_property_type ( self . type_ ( ) , false , & pspec, & mut property_value) ;
2311
2311
unsafe {
2312
2312
gobject_ffi:: g_object_set_property (
@@ -3642,7 +3642,7 @@ impl<'a, 'f, 't> BindingBuilder<'a, 'f, 't> {
3642
3642
/// See [`Self::transform_from_with_values`] for a version which operates on `glib::Value`s.
3643
3643
pub fn transform_from <
3644
3644
S : FromValue < ' f > ,
3645
- T : ToValue ,
3645
+ T : Into < Value > ,
3646
3646
F : Fn ( & ' f crate :: Binding , S ) -> Option < T > + Send + Sync + ' static ,
3647
3647
> (
3648
3648
self ,
@@ -3651,7 +3651,7 @@ impl<'a, 'f, 't> BindingBuilder<'a, 'f, 't> {
3651
3651
Self {
3652
3652
transform_from : Some ( Box :: new ( move |binding, from_value| {
3653
3653
let from_value = from_value. get ( ) . expect ( "Wrong value type" ) ;
3654
- func ( binding, from_value) . map ( |r| r. to_value ( ) )
3654
+ func ( binding, from_value) . map ( |r| r. into ( ) )
3655
3655
} ) ) ,
3656
3656
..self
3657
3657
}
@@ -3681,7 +3681,7 @@ impl<'a, 'f, 't> BindingBuilder<'a, 'f, 't> {
3681
3681
/// See [`Self::transform_to_with_values`] for a version which operates on `glib::Value`s.
3682
3682
pub fn transform_to <
3683
3683
S : FromValue < ' t > ,
3684
- T : ToValue ,
3684
+ T : Into < Value > ,
3685
3685
F : Fn ( & ' t crate :: Binding , S ) -> Option < T > + Send + Sync + ' static ,
3686
3686
> (
3687
3687
self ,
@@ -3690,7 +3690,7 @@ impl<'a, 'f, 't> BindingBuilder<'a, 'f, 't> {
3690
3690
Self {
3691
3691
transform_to : Some ( Box :: new ( move |binding, from_value| {
3692
3692
let from_value = from_value. get ( ) . expect ( "Wrong value type" ) ;
3693
- func ( binding, from_value) . map ( |r| r. to_value ( ) )
3693
+ func ( binding, from_value) . map ( |r| r. into ( ) )
3694
3694
} ) ) ,
3695
3695
..self
3696
3696
}
0 commit comments