fn encode_godot_types(dictionary: &mut Dictionary, key: &str, value: &str) {
	// Create a pattern to check for Godot types (Vector2, Rect2, etc.) and check to see if there are any matches in the string.
	// let type_re = Regex::new(r"((?:\/)?(\w+))").expect("Unable to create regex for type");
	let type_re =
		Regex::new(r"((?:\/)?([a-zA-Z0-9\.]+))").expect("Unable to create regex for type");
	let mut type_idx = 0;
	let mut type_results: Vec<&str> = vec![];
	while let Some(t) = type_re
		.captures_from_pos(value, type_idx)
		.expect("Unable to get captures")
	{
		type_results.push(t.get(1).expect("Unable to get capture group").as_str());
		type_idx = t.get(0).expect("Unable to get capture group").end();
	}

	let godot_types: [&str; 8] = [
		"Vector2",
		"Vector3",
		"Color",
		"Rect2",
		"Plane",
		"Transform2D",
		"Basis",
		"Transform",
	];

	if !godot_types.contains(&type_results[0]) {
		dictionary.set(&Variant::from_str(&key), &Variant::from_str(&value));
		return;
	}

	// If there is a pattern then we need to decode the regex results into the Godot type.
	set_godot_type_to_dictionary(type_results, key, dictionary, &mut None, &mut None);
}
/// Checks to see if a toml string is a Godot type and if so use `set_godot_type_to_dictionary`
///
/// # Arguments
///
/// `dictionary` - A reference to the dictionary so that the Godot types can be added to it.
/// `key` - The key of the current string item being checked.
/// `value` - The value of the current string item being checked.
Checks to see if a toml string is a Godot type and if so use `set_godot_type_to_dictionary`
Checks to see if a toml string is a Godot type and if so use ` set_godot_type_to_dictionary `
fn encode_godot_types(dictionary: &mut Dictionary, key: &str, value: &str) {
	// Create a pattern to check for Godot types (Vector2, Rect2, etc.) and check to see if there are any matches in the string.
	// let type_re = Regex::new(r"((?:\/)?(\w+))").expect("Unable to create regex for type");
	let type_re =
		Regex::new(r"((?:\/)?([a-zA-Z0-9\.]+))").expect("Unable to create regex for type");
	let mut type_idx = 0;
	let mut type_results: Vec<&str> = vec![];
	while let Some(t) = type_re
		.captures_from_pos(value, type_idx)
		.expect("Unable to get captures")
	{
		type_results.push(t.get(1).expect("Unable to get capture group").as_str());
		type_idx = t.get(0).expect("Unable to get capture group").end();
	}
	let godot_types: [&str; 8] = [
		"Vector2",
		"Vector3",
		"Color",
		"Rect2",
		"Plane",
		"Transform2D",
		"Basis",
		"Transform",
	];
	if !godot_types.contains(&type_results[0]) {
		dictionary.set(&Variant::from_str(&key), &Variant::from_str(&value));
		return;
	}
	// If there is a pattern then we need to decode the regex results into the Godot type.
	set_godot_type_to_dictionary(type_results, key, dictionary, &mut None, &mut None);
}
fn encode_godot_types ( dictionary : & mut Dictionary , key : & str , value : & str ) { // Create a pattern to check for Godot types (Vector2, Rect2, etc.) and check to see if there are any matches in the string. // let type_re = Regex::new(r"((?:\/)?(\w+))").expect("Unable to create regex for type"); let type_re = Regex :: new ( r"((?:\/)?([a-zA-Z0-9\.]+))" ) . expect ( " " ) ; let mut type_idx = 0 ; let mut type_results : Vec < & str > = vec ! [ ] ; while let Some ( t ) = type_re . captures_from_pos ( value , type_idx ) . expect ( " " ) { type_results . push ( t . get ( 1 ) . expect ( " " ) . as_str ( ) ) ; type_idx = t . get ( 0 ) . expect ( " " ) . end ( ) ; } let godot_types : [ & str ; 8 ] = [ " " , " " , " " , " " , " " , " " , " " , " " , ] ; if ! godot_types . contains ( & type_results [ 0 ] ) { dictionary . set ( & Variant :: from_str ( & key ) , & Variant :: from_str ( & value ) ) ; return ; } // If there is a pattern then we need to decode the regex results into the Godot type. set_godot_type_to_dictionary ( type_results , key , dictionary , & mut None , & mut None ) ; }
Checks to see if a toml string is a Godot type and if so use `set_godot_type_to_dictionary`
Checks to see if a toml string is a Godot type and if so use ` set_godot_type_to_dictionary `
dictionary
&mut Dictionary
key
&str
value
&str