File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 3
3
// rustdoc-stripper-ignore-next
4
4
//! Runtime type information.
5
5
6
- use std:: { fmt, mem, ptr} ;
6
+ use std:: { fmt, marker :: PhantomData , mem, ptr} ;
7
7
8
8
use crate :: { translate:: * , Slice } ;
9
9
@@ -508,16 +508,14 @@ impl IntoGlib for Type {
508
508
}
509
509
510
510
impl < ' a > ToGlibContainerFromSlice < ' a , * mut ffi:: GType > for Type {
511
- type Storage = Option < Vec < ffi :: GType > > ;
511
+ type Storage = PhantomData < & ' a [ Type ] > ;
512
512
513
513
fn to_glib_none_from_slice ( t : & ' a [ Type ] ) -> ( * mut ffi:: GType , Self :: Storage ) {
514
- let mut vec = t. iter ( ) . map ( |t| t. into_glib ( ) ) . collect :: < Vec < _ > > ( ) ;
515
-
516
- ( vec. as_mut_ptr ( ) , Some ( vec) )
514
+ ( t. as_ptr ( ) as * mut ffi:: GType , PhantomData )
517
515
}
518
516
519
517
fn to_glib_container_from_slice ( t : & ' a [ Type ] ) -> ( * mut ffi:: GType , Self :: Storage ) {
520
- ( Self :: to_glib_full_from_slice ( t) , None )
518
+ ( Self :: to_glib_full_from_slice ( t) , PhantomData )
521
519
}
522
520
523
521
fn to_glib_full_from_slice ( t : & [ Type ] ) -> * mut ffi:: GType {
You can’t perform that action at this time.
0 commit comments