File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -928,21 +928,23 @@ impl ComponentDefinition {
928
928
self . inner . unerase ( guard) . type_loader . get ( ) . unwrap ( ) . clone ( )
929
929
}
930
930
931
- /// Return the `TypeLoader` used when parsing the code in the interpreter.
931
+ /// Return the `TypeLoader` used when parsing the code in the interpreter in
932
+ /// a state before most passes were applied by the compiler.
933
+ ///
934
+ /// Each returned type loader is a deep copy of the entire state connected to it,
935
+ /// so this is a fairly expensive function!
932
936
///
933
937
/// WARNING: this is not part of the public API
934
938
#[ cfg( feature = "highlight" ) ]
935
939
pub fn raw_type_loader ( & self ) -> Option < i_slint_compiler:: typeloader:: TypeLoader > {
936
- use i_slint_compiler:: typeloader;
937
-
938
940
let guard = unsafe { generativity:: Guard :: new ( generativity:: Id :: new ( ) ) } ;
939
941
self . inner
940
942
. unerase ( guard)
941
943
. raw_type_loader
942
944
. get ( )
943
945
. unwrap ( )
944
946
. as_ref ( )
945
- . map ( |tl| typeloader:: snapshot ( tl) . unwrap ( ) )
947
+ . and_then ( |tl| i_slint_compiler :: typeloader:: snapshot ( tl) )
946
948
}
947
949
}
948
950
You can’t perform that action at this time.
0 commit comments