88use std:: fmt;
99use std:: marker:: PhantomData ;
1010
11- use crate :: builtin:: meta:: {
12- ArrayElement , ConvertError , FromGodot , FromGodotError , FromVariantError , GodotConvert ,
13- GodotFfiVariant , GodotType , ToGodot ,
14- } ;
1511use crate :: builtin:: * ;
12+ use crate :: meta:: error:: { ConvertError , FromGodotError , FromVariantError } ;
13+ use crate :: meta:: {
14+ ArrayElement , ArrayTypeInfo , FromGodot , GodotConvert , GodotFfiVariant , GodotType , ToGodot ,
15+ } ;
1616use crate :: obj:: EngineEnum ;
1717use crate :: registry:: property:: {
1818 builtin_type_string, Export , PropertyHintInfo , TypeStringHint , Var ,
@@ -1165,7 +1165,7 @@ macro_rules! varray {
11651165 // Note: use to_variant() and not Variant::from(), as that works with both references and values
11661166 ( $( $elements: expr) ,* $( , ) ?) => {
11671167 {
1168- use $crate:: builtin :: meta:: ToGodot as _;
1168+ use $crate:: meta:: ToGodot as _;
11691169 let mut array = $crate:: builtin:: VariantArray :: default ( ) ;
11701170 $(
11711171 array. push( $elements. to_variant( ) ) ;
@@ -1177,52 +1177,6 @@ macro_rules! varray {
11771177
11781178// ----------------------------------------------------------------------------------------------------------------------------------------------
11791179
1180- /// Represents the type information of a Godot array. See
1181- /// [`set_typed`](https://docs.godotengine.org/en/latest/classes/class_array.html#class-array-method-set-typed).
1182- ///
1183- /// We ignore the `script` parameter because it has no impact on typing in Godot.
1184- #[ derive( Eq , PartialEq ) ]
1185- pub ( crate ) struct ArrayTypeInfo {
1186- variant_type : VariantType ,
1187-
1188- /// Not a `ClassName` because some values come from Godot engine API.
1189- class_name : StringName ,
1190- }
1191-
1192- impl ArrayTypeInfo {
1193- fn of < T : GodotType > ( ) -> Self {
1194- Self {
1195- variant_type : <T :: Via as GodotType >:: Ffi :: variant_type ( ) ,
1196- class_name : T :: Via :: class_name ( ) . to_string_name ( ) ,
1197- }
1198- }
1199-
1200- pub fn is_typed ( & self ) -> bool {
1201- self . variant_type != VariantType :: NIL
1202- }
1203-
1204- pub fn variant_type ( & self ) -> VariantType {
1205- self . variant_type
1206- }
1207-
1208- pub fn class_name ( & self ) -> & StringName {
1209- & self . class_name
1210- }
1211- }
1212-
1213- impl fmt:: Debug for ArrayTypeInfo {
1214- fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
1215- let class = self . class_name . to_string ( ) ;
1216- let class_str = if class. is_empty ( ) {
1217- String :: new ( )
1218- } else {
1219- format ! ( " (class={class})" )
1220- } ;
1221-
1222- write ! ( f, "{:?}{}" , self . variant_type, class_str)
1223- }
1224- }
1225-
12261180#[ cfg( feature = "serde" ) ]
12271181mod serialize {
12281182 use super :: * ;
0 commit comments