From 187d39f19d02426b258e079f220eea5f1eae6624 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Sun, 13 Aug 2023 07:53:31 +0000 Subject: [PATCH] style: format code with rustfmt Format code with rustfmt This commit fixes the style issues introduced in a353137 according to the output from Rustfmt. Details: None --- src/rpkg_structs.rs | 24 +++---- src/rt_structs.rs | 148 ++++++++++++++++++++++---------------------- 2 files changed, 86 insertions(+), 86 deletions(-) diff --git a/src/rpkg_structs.rs b/src/rpkg_structs.rs index c24b6f4..09486e5 100644 --- a/src/rpkg_structs.rs +++ b/src/rpkg_structs.rs @@ -2,20 +2,20 @@ use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, Hash, Default)] pub struct ResourceMeta { - pub hash_offset: u64, - pub hash_reference_data: Vec, - pub hash_reference_table_dummy: u64, - pub hash_reference_table_size: u64, - pub hash_resource_type: String, - pub hash_size: u64, - pub hash_size_final: u64, - pub hash_size_in_memory: u64, - pub hash_size_in_video_memory: u64, - pub hash_value: String + pub hash_offset: u64, + pub hash_reference_data: Vec, + pub hash_reference_table_dummy: u64, + pub hash_reference_table_size: u64, + pub hash_resource_type: String, + pub hash_size: u64, + pub hash_size_final: u64, + pub hash_size_in_memory: u64, + pub hash_size_in_video_memory: u64, + pub hash_value: String, } #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, Hash, Default)] pub struct ResourceDependency { - pub hash: String, - pub flag: String + pub hash: String, + pub flag: String, } diff --git a/src/rt_structs.rs b/src/rt_structs.rs index d75828f..d5cc4fb 100644 --- a/src/rt_structs.rs +++ b/src/rt_structs.rs @@ -3,154 +3,154 @@ use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Debug, Clone)] #[serde(rename_all = "camelCase")] pub struct STemplateBlueprintSubEntity { - pub logical_parent: SEntityTemplateReference, - pub entity_type_resource_index: usize, - - #[serde(rename = "entityId")] - pub entity_id: u64, - - pub editor_only: bool, - pub entity_name: String, - pub property_aliases: Vec, - pub exposed_entities: Vec, - pub exposed_interfaces: Vec<(String, usize)>, - pub entity_subsets: Vec<(String, SEntityTemplateEntitySubset)> + pub logical_parent: SEntityTemplateReference, + pub entity_type_resource_index: usize, + + #[serde(rename = "entityId")] + pub entity_id: u64, + + pub editor_only: bool, + pub entity_name: String, + pub property_aliases: Vec, + pub exposed_entities: Vec, + pub exposed_interfaces: Vec<(String, usize)>, + pub entity_subsets: Vec<(String, SEntityTemplateEntitySubset)>, } #[derive(Serialize, Deserialize, Debug, Clone, Default)] #[serde(rename_all = "camelCase")] pub struct RTBlueprint { - pub sub_type: i8, - pub root_entity_index: usize, - pub sub_entities: Vec, - pub external_scene_type_indices_in_resource_header: Vec, - pub pin_connections: Vec, - pub input_pin_forwardings: Vec, - pub output_pin_forwardings: Vec, - pub override_deletes: Vec, - pub pin_connection_overrides: Vec, - pub pin_connection_override_deletes: Vec + pub sub_type: i8, + pub root_entity_index: usize, + pub sub_entities: Vec, + pub external_scene_type_indices_in_resource_header: Vec, + pub pin_connections: Vec, + pub input_pin_forwardings: Vec, + pub output_pin_forwardings: Vec, + pub override_deletes: Vec, + pub pin_connection_overrides: Vec, + pub pin_connection_override_deletes: Vec, } #[derive(Serialize, Deserialize, Debug, Clone)] #[serde(rename_all = "camelCase")] pub struct STemplateFactorySubEntity { - pub logical_parent: SEntityTemplateReference, - pub entity_type_resource_index: usize, - pub property_values: Vec, - pub post_init_property_values: Vec, + pub logical_parent: SEntityTemplateReference, + pub entity_type_resource_index: usize, + pub property_values: Vec, + pub post_init_property_values: Vec, - #[serde(default = "Vec::new")] // H2 does not have this property - pub platform_specific_property_values: Vec + #[serde(default = "Vec::new")] // H2 does not have this property + pub platform_specific_property_values: Vec, } #[derive(Serialize, Deserialize, Debug, Clone, Default)] #[serde(rename_all = "camelCase")] pub struct RTFactory { - pub sub_type: i8, - pub blueprint_index_in_resource_header: i32, - pub root_entity_index: usize, - pub sub_entities: Vec, - pub property_overrides: Vec, - pub external_scene_type_indices_in_resource_header: Vec + pub sub_type: i8, + pub blueprint_index_in_resource_header: i32, + pub root_entity_index: usize, + pub sub_entities: Vec, + pub property_overrides: Vec, + pub external_scene_type_indices_in_resource_header: Vec, } #[derive(Serialize, Deserialize, Debug, Clone)] #[serde(rename_all = "camelCase")] pub struct SEntityTemplateReference { - #[serde(rename = "entityID")] - pub entity_id: u64, + #[serde(rename = "entityID")] + pub entity_id: u64, - pub external_scene_index: i32, - pub entity_index: i32, - pub exposed_entity: String + pub external_scene_index: i32, + pub entity_index: i32, + pub exposed_entity: String, } #[derive(Serialize, Deserialize, Debug, Clone)] #[serde(rename_all = "camelCase")] pub struct SEntityTemplateExposedEntity { - pub s_name: String, - pub b_is_array: bool, - pub a_targets: Vec + pub s_name: String, + pub b_is_array: bool, + pub a_targets: Vec, } #[derive(Serialize, Deserialize, Debug, Clone)] #[serde(rename_all = "camelCase")] pub struct SEntityTemplatePinConnection { - #[serde(rename = "fromID")] - pub from_id: usize, + #[serde(rename = "fromID")] + pub from_id: usize, - #[serde(rename = "toID")] - pub to_id: usize, + #[serde(rename = "toID")] + pub to_id: usize, - pub from_pin_name: String, - pub to_pin_name: String, - pub constant_pin_value: SEntityTemplatePropertyValue + pub from_pin_name: String, + pub to_pin_name: String, + pub constant_pin_value: SEntityTemplatePropertyValue, } #[derive(Serialize, Deserialize, Debug, Clone)] #[serde(rename_all = "camelCase")] pub struct SEntityTemplatePlatformSpecificProperty { - pub property_value: SEntityTemplateProperty, - pub platform: String, - pub post_init: bool + pub property_value: SEntityTemplateProperty, + pub platform: String, + pub post_init: bool, } #[derive(Serialize, Deserialize, Debug, Clone)] #[serde(rename_all = "camelCase")] pub struct SEntityTemplatePropertyAlias { - pub s_alias_name: String, + pub s_alias_name: String, - #[serde(rename = "entityID")] - pub entity_id: usize, + #[serde(rename = "entityID")] + pub entity_id: usize, - pub s_property_name: String + pub s_property_name: String, } #[derive(Serialize, Deserialize, Debug, Clone)] #[serde(rename_all = "camelCase")] pub struct SEntityTemplatePropertyOverride { - pub property_owner: SEntityTemplateReference, - pub property_value: SEntityTemplateProperty + pub property_owner: SEntityTemplateReference, + pub property_value: SEntityTemplateProperty, } #[derive(Serialize, Deserialize, Debug, Clone)] #[serde(rename_all = "camelCase")] pub struct SEntityTemplateEntitySubset { - pub entities: Vec + pub entities: Vec, } #[derive(Serialize, Deserialize, Debug, Clone)] #[serde(rename_all = "camelCase")] pub struct SExternalEntityTemplatePinConnection { - pub from_entity: SEntityTemplateReference, - pub to_entity: SEntityTemplateReference, - pub from_pin_name: String, - pub to_pin_name: String, - pub constant_pin_value: SEntityTemplatePropertyValue + pub from_entity: SEntityTemplateReference, + pub to_entity: SEntityTemplateReference, + pub from_pin_name: String, + pub to_pin_name: String, + pub constant_pin_value: SEntityTemplatePropertyValue, } #[derive(Serialize, Deserialize, Debug, Clone)] pub struct SEntityTemplateProperty { - #[serde(rename = "nPropertyID")] - pub n_property_id: PropertyID, + #[serde(rename = "nPropertyID")] + pub n_property_id: PropertyID, - #[serde(rename = "value")] - pub value: SEntityTemplatePropertyValue + #[serde(rename = "value")] + pub value: SEntityTemplatePropertyValue, } #[derive(Serialize, Deserialize, Debug, Clone)] pub struct SEntityTemplatePropertyValue { - #[serde(rename = "$type")] - pub property_type: String, + #[serde(rename = "$type")] + pub property_type: String, - #[serde(rename = "$val")] - pub property_value: serde_json::Value + #[serde(rename = "$val")] + pub property_value: serde_json::Value, } #[derive(Serialize, Deserialize, Debug, Clone)] #[serde(untagged)] pub enum PropertyID { - Int(u64), - String(String) + Int(u64), + String(String), }