@@ -181,7 +181,7 @@ macro_rules! glib_boxed_inline_wrapper {
181
181
182
182
#[ doc( hidden) ]
183
183
impl <' a $( , $( $generic $( : $bound $( + $bound2) * ) ?) ,+) ?> $crate:: translate:: ToGlibPtr <' a, * const $ffi_name> for $name $( <$( $generic) ,+>) ? {
184
- type Storage = & ' a $name $ ( <$ ( $generic ) ,+> ) ? ;
184
+ type Storage = & ' a Self ;
185
185
186
186
#[ inline]
187
187
fn to_glib_none( & ' a self ) -> $crate:: translate:: Stash <' a, * const $ffi_name, Self > {
@@ -199,7 +199,7 @@ macro_rules! glib_boxed_inline_wrapper {
199
199
200
200
#[ doc( hidden) ]
201
201
impl <' a $( , $( $generic $( : $bound $( + $bound2) * ) ?) ,+) ?> $crate:: translate:: ToGlibPtrMut <' a, * mut $ffi_name> for $name $( <$( $generic) ,+>) ? {
202
- type Storage = & ' a mut $name $ ( <$ ( $generic ) ,+> ) ? ;
202
+ type Storage = & ' a mut Self ;
203
203
204
204
#[ inline]
205
205
fn to_glib_none_mut( & ' a mut self ) -> $crate:: translate:: StashMut <' a, * mut $ffi_name, Self > {
@@ -212,14 +212,14 @@ macro_rules! glib_boxed_inline_wrapper {
212
212
impl <' a $( , $( $generic $( : $bound $( + $bound2) * ) ?) ,+) ?> $crate:: translate:: ToGlibContainerFromSlice <' a, * mut * const $ffi_name> for $name $( <$( $generic) ,+>) ? {
213
213
type Storage = Option <Vec <* const $ffi_name>>;
214
214
215
- fn to_glib_none_from_slice( t: & ' a [ $name $ ( <$ ( $generic ) ,+> ) ? ] ) -> ( * mut * const $ffi_name, Self :: Storage ) {
215
+ fn to_glib_none_from_slice( t: & ' a [ Self ] ) -> ( * mut * const $ffi_name, Self :: Storage ) {
216
216
let mut v: Vec <_> = t. iter( ) . map( |s| & s. inner as * const $ffi_name) . collect( ) ;
217
217
v. push( std:: ptr:: null_mut( ) as * const $ffi_name) ;
218
218
219
219
( v. as_mut_ptr( ) , Some ( v) )
220
220
}
221
221
222
- fn to_glib_container_from_slice( t: & ' a [ $name $ ( <$ ( $generic ) ,+> ) ? ] ) -> ( * mut * const $ffi_name, Self :: Storage ) {
222
+ fn to_glib_container_from_slice( t: & ' a [ Self ] ) -> ( * mut * const $ffi_name, Self :: Storage ) {
223
223
let v_ptr = unsafe {
224
224
let v_ptr = $crate:: ffi:: g_malloc0( std:: mem:: size_of:: <* const $ffi_name>( ) * ( t. len( ) + 1 ) ) as * mut * const $ffi_name;
225
225
@@ -233,7 +233,7 @@ macro_rules! glib_boxed_inline_wrapper {
233
233
( v_ptr, None )
234
234
}
235
235
236
- fn to_glib_full_from_slice( t: & [ $name $ ( <$ ( $generic ) ,+> ) ? ] ) -> * mut * const $ffi_name {
236
+ fn to_glib_full_from_slice( t: & [ Self ] ) -> * mut * const $ffi_name {
237
237
unsafe {
238
238
let v_ptr = $crate:: ffi:: g_malloc0( std:: mem:: size_of:: <* const $ffi_name>( ) * ( t. len( ) + 1 ) ) as * mut * const $ffi_name;
239
239
@@ -250,38 +250,38 @@ macro_rules! glib_boxed_inline_wrapper {
250
250
impl <' a $( , $( $generic $( : $bound $( + $bound2) * ) ?) ,+) ?> $crate:: translate:: ToGlibContainerFromSlice <' a, * const * const $ffi_name> for $name $( <$( $generic) ,+>) ? {
251
251
type Storage = Option <Vec <* const $ffi_name>>;
252
252
253
- fn to_glib_none_from_slice( t: & ' a [ $name $ ( <$ ( $generic ) ,+> ) ? ] ) -> ( * const * const $ffi_name, Self :: Storage ) {
253
+ fn to_glib_none_from_slice( t: & ' a [ Self ] ) -> ( * const * const $ffi_name, Self :: Storage ) {
254
254
let ( ptr, stash) = $crate:: translate:: ToGlibContainerFromSlice :: <' a, * mut * const $ffi_name>:: to_glib_none_from_slice( t) ;
255
255
( ptr as * const * const $ffi_name, stash)
256
256
}
257
257
258
- fn to_glib_container_from_slice( _: & ' a [ $name $ ( <$ ( $generic ) ,+> ) ? ] ) -> ( * const * const $ffi_name, Self :: Storage ) {
258
+ fn to_glib_container_from_slice( _: & ' a [ Self ] ) -> ( * const * const $ffi_name, Self :: Storage ) {
259
259
// Can't have consumer free a *const pointer
260
260
unimplemented!( )
261
261
}
262
262
263
- fn to_glib_full_from_slice( _: & [ $name $ ( <$ ( $generic ) ,+> ) ? ] ) -> * const * const $ffi_name {
263
+ fn to_glib_full_from_slice( _: & [ Self ] ) -> * const * const $ffi_name {
264
264
// Can't have consumer free a *const pointer
265
265
unimplemented!( )
266
266
}
267
267
}
268
268
269
269
#[ doc( hidden) ]
270
270
impl <' a $( , $( $generic $( : $bound $( + $bound2) * ) ?) ,+) ?> $crate:: translate:: ToGlibContainerFromSlice <' a, * mut $ffi_name> for $name $( <$( $generic) ,+>) ? {
271
- type Storage = Option <& ' a [ $name $ ( <$ ( $generic ) ,+> ) ? ] >;
271
+ type Storage = Option <& ' a [ Self ] >;
272
272
273
- fn to_glib_none_from_slice( t: & ' a [ $name $ ( <$ ( $generic ) ,+> ) ? ] ) -> ( * mut $ffi_name, Self :: Storage ) {
273
+ fn to_glib_none_from_slice( t: & ' a [ Self ] ) -> ( * mut $ffi_name, Self :: Storage ) {
274
274
( t. as_ptr( ) as * mut $ffi_name, Some ( t) )
275
275
}
276
276
277
- fn to_glib_container_from_slice( t: & ' a [ $name $ ( <$ ( $generic ) ,+> ) ? ] ) -> ( * mut $ffi_name, Self :: Storage ) {
277
+ fn to_glib_container_from_slice( t: & ' a [ Self ] ) -> ( * mut $ffi_name, Self :: Storage ) {
278
278
(
279
279
$crate:: translate:: ToGlibContainerFromSlice :: <' a, * mut $ffi_name>:: to_glib_full_from_slice( t) ,
280
280
None ,
281
281
)
282
282
}
283
283
284
- fn to_glib_full_from_slice( t: & [ $name $ ( <$ ( $generic ) ,+> ) ? ] ) -> * mut $ffi_name {
284
+ fn to_glib_full_from_slice( t: & [ Self ] ) -> * mut $ffi_name {
285
285
let v_ptr = unsafe {
286
286
let v_ptr = $crate:: ffi:: g_malloc0( std:: mem:: size_of:: <$ffi_name>( ) ) as * mut $ffi_name;
287
287
@@ -299,19 +299,19 @@ macro_rules! glib_boxed_inline_wrapper {
299
299
300
300
#[ doc( hidden) ]
301
301
impl <' a $( , $( $generic $( : $bound $( + $bound2) * ) ?) ,+) ?> $crate:: translate:: ToGlibContainerFromSlice <' a, * const $ffi_name> for $name $( <$( $generic) ,+>) ? {
302
- type Storage = Option <& ' a [ $name $ ( <$ ( $generic ) ,+> ) ? ] >;
302
+ type Storage = Option <& ' a [ Self ] >;
303
303
304
- fn to_glib_none_from_slice( t: & ' a [ $name $ ( <$ ( $generic ) ,+> ) ? ] ) -> ( * const $ffi_name, Self :: Storage ) {
304
+ fn to_glib_none_from_slice( t: & ' a [ Self ] ) -> ( * const $ffi_name, Self :: Storage ) {
305
305
let ( ptr, stash) = $crate:: translate:: ToGlibContainerFromSlice :: <' a, * mut $ffi_name>:: to_glib_none_from_slice( t) ;
306
306
( ptr as * const $ffi_name, stash)
307
307
}
308
308
309
- fn to_glib_container_from_slice( _: & ' a [ $name $ ( <$ ( $generic ) ,+> ) ? ] ) -> ( * const $ffi_name, Self :: Storage ) {
309
+ fn to_glib_container_from_slice( _: & ' a [ Self ] ) -> ( * const $ffi_name, Self :: Storage ) {
310
310
// Can't have consumer free a *const pointer
311
311
unimplemented!( )
312
312
}
313
313
314
- fn to_glib_full_from_slice( _: & [ $name $ ( <$ ( $generic ) ,+> ) ? ] ) -> * const $ffi_name {
314
+ fn to_glib_full_from_slice( _: & [ Self ] ) -> * const $ffi_name {
315
315
// Can't have consumer free a *const pointer
316
316
unimplemented!( )
317
317
}
@@ -323,7 +323,7 @@ macro_rules! glib_boxed_inline_wrapper {
323
323
unsafe fn from_glib_none( ptr: * mut $ffi_name) -> Self {
324
324
assert!( !ptr. is_null( ) ) ;
325
325
326
- let mut v = <$name $ ( <$ ( $generic ) ,+> ) ? as $crate:: translate:: Uninitialized >:: uninitialized( ) ;
326
+ let mut v = <Self as $crate:: translate:: Uninitialized >:: uninitialized( ) ;
327
327
let copy_into = |$copy_into_arg_dest: * mut $ffi_name, $copy_into_arg_src: * const $ffi_name| $copy_into_expr;
328
328
copy_into( & mut v. inner as * mut $ffi_name, ptr as * const $ffi_name) ;
329
329
@@ -335,7 +335,7 @@ macro_rules! glib_boxed_inline_wrapper {
335
335
impl $( <$( $generic $( : $bound $( + $bound2) * ) ?) ,+>) ? $crate:: translate:: FromGlibPtrNone <* const $ffi_name> for $name $( <$( $generic) ,+>) ? {
336
336
#[ inline]
337
337
unsafe fn from_glib_none( ptr: * const $ffi_name) -> Self {
338
- $crate:: translate:: from_glib_none:: <_, $name $ ( <$ ( $generic ) ,+> ) ? >( ptr as * mut $ffi_name)
338
+ $crate:: translate:: from_glib_none:: <_, Self >( ptr as * mut $ffi_name)
339
339
}
340
340
}
341
341
@@ -345,7 +345,7 @@ macro_rules! glib_boxed_inline_wrapper {
345
345
unsafe fn from_glib_full( ptr: * mut $ffi_name) -> Self {
346
346
assert!( !ptr. is_null( ) ) ;
347
347
348
- let mut v = <$name $ ( <$ ( $generic ) ,+> ) ? as $crate:: translate:: Uninitialized >:: uninitialized( ) ;
348
+ let mut v = <Self as $crate:: translate:: Uninitialized >:: uninitialized( ) ;
349
349
let copy_into = |$copy_into_arg_dest: * mut $ffi_name, $copy_into_arg_src: * const $ffi_name| $copy_into_expr;
350
350
copy_into( & mut v. inner as * mut $ffi_name, ptr as * const $ffi_name) ;
351
351
@@ -360,7 +360,7 @@ macro_rules! glib_boxed_inline_wrapper {
360
360
impl $( <$( $generic $( : $bound $( + $bound2) * ) ?) ,+>) ? $crate:: translate:: FromGlibPtrFull <* const $ffi_name> for $name $( <$( $generic) ,+>) ? {
361
361
#[ inline]
362
362
unsafe fn from_glib_full( ptr: * const $ffi_name) -> Self {
363
- $crate:: translate:: from_glib_full:: <_, $name $ ( <$ ( $generic ) ,+> ) ? >( ptr as * mut $ffi_name)
363
+ $crate:: translate:: from_glib_full:: <_, Self >( ptr as * mut $ffi_name)
364
364
}
365
365
}
366
366
@@ -381,7 +381,7 @@ macro_rules! glib_boxed_inline_wrapper {
381
381
impl $( <$( $generic $( : $bound $( + $bound2) * ) ?) ,+>) ? $crate:: translate:: FromGlibPtrBorrow <* const $ffi_name> for $name $( <$( $generic) ,+>) ? {
382
382
#[ inline]
383
383
unsafe fn from_glib_borrow( ptr: * const $ffi_name) -> $crate:: translate:: Borrowed <Self > {
384
- $crate:: translate:: from_glib_borrow:: <_, $name $ ( <$ ( $generic ) ,+> ) ? >( ptr as * mut $ffi_name)
384
+ $crate:: translate:: from_glib_borrow:: <_, Self >( ptr as * mut $ffi_name)
385
385
}
386
386
}
387
387
@@ -496,7 +496,7 @@ macro_rules! glib_boxed_inline_wrapper {
496
496
497
497
#[ doc( hidden) ]
498
498
impl $( <$( $generic $( : $bound $( + $bound2) * ) ?) ,+>) ? $crate:: value:: ValueType for $name $( <$( $generic) ,+>) ? {
499
- type Type = $name $ ( <$ ( $generic ) ,+> ) ? ;
499
+ type Type = Self ;
500
500
}
501
501
502
502
#[ doc( hidden) ]
@@ -506,7 +506,7 @@ macro_rules! glib_boxed_inline_wrapper {
506
506
unsafe fn from_value( value: & ' a $crate:: Value ) -> Self {
507
507
let ptr = $crate:: gobject_ffi:: g_value_get_boxed( $crate:: translate:: ToGlibPtr :: to_glib_none( value) . 0 ) ;
508
508
assert!( !ptr. is_null( ) ) ;
509
- <$name $ ( <$ ( $generic ) ,+> ) ? as $crate:: translate:: FromGlibPtrNone <* const $ffi_name>>:: from_glib_none( ptr as * const $ffi_name)
509
+ <Self as $crate:: translate:: FromGlibPtrNone <* const $ffi_name>>:: from_glib_none( ptr as * const $ffi_name)
510
510
}
511
511
}
512
512
@@ -525,7 +525,7 @@ macro_rules! glib_boxed_inline_wrapper {
525
525
impl $( <$( $generic $( : $bound $( + $bound2) * ) ?) ,+>) ? $crate:: value:: ToValue for $name $( <$( $generic) ,+>) ? {
526
526
fn to_value( & self ) -> $crate:: Value {
527
527
unsafe {
528
- let mut value = $crate:: Value :: from_type( <$name $ ( <$ ( $generic ) ,+> ) ? as $crate:: StaticType >:: static_type( ) ) ;
528
+ let mut value = $crate:: Value :: from_type( <Self as $crate:: StaticType >:: static_type( ) ) ;
529
529
$crate:: gobject_ffi:: g_value_set_boxed(
530
530
$crate:: translate:: ToGlibPtrMut :: to_glib_none_mut( & mut value) . 0 ,
531
531
$crate:: translate:: ToGlibPtr :: <* const $ffi_name>:: to_glib_none( self ) . 0 as * mut _,
@@ -535,7 +535,7 @@ macro_rules! glib_boxed_inline_wrapper {
535
535
}
536
536
537
537
fn value_type( & self ) -> $crate:: Type {
538
- <$name $ ( <$ ( $generic ) ,+> ) ? as $crate:: StaticType >:: static_type( )
538
+ <Self as $crate:: StaticType >:: static_type( )
539
539
}
540
540
}
541
541
0 commit comments