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 33// rustdoc-stripper-ignore-next
44//! Runtime type information.
55
6- use std:: { fmt, mem, ptr} ;
6+ use std:: { fmt, marker :: PhantomData , mem, ptr} ;
77
88use crate :: { translate:: * , Slice } ;
99
@@ -508,16 +508,14 @@ impl IntoGlib for Type {
508508}
509509
510510impl < ' a > ToGlibContainerFromSlice < ' a , * mut ffi:: GType > for Type {
511- type Storage = Option < Vec < ffi :: GType > > ;
511+ type Storage = PhantomData < & ' a [ Type ] > ;
512512
513513 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 )
517515 }
518516
519517 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 )
521519 }
522520
523521 fn to_glib_full_from_slice ( t : & [ Type ] ) -> * mut ffi:: GType {
You can’t perform that action at this time.
0 commit comments