diff --git a/Cargo.toml b/Cargo.toml index 51207bf..7978bb8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,16 +8,16 @@ repository = "https://github.com/localcc/gvas" readme = "README.md" license = "MIT" version = "0.10.0" -edition = "2021" +edition = "2024" [dependencies] enum_dispatch = "0.3.13" byteorder = "1.5.0" -ordered-float = "4.4.0" +ordered-float = "5.0.0" serde = { version = "1.0.210", optional = true, features = ["derive"] } serde_with = { version = "3.11.0", optional = true, features = ["hex"] } indexmap = "2.6.0" -thiserror = "1.0.64" +thiserror = "2.0.12" num_enum = "0.7.3" flate2 = "1.0.34" cfg_eval = "0.1.2" diff --git a/src/error.rs b/src/error.rs index 004d92e..2b349d5 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,6 +1,6 @@ use std::{ io, - string::{FromUtf16Error, FromUtf8Error}, + string::{FromUtf8Error, FromUtf16Error}, }; use thiserror::Error; diff --git a/src/lib.rs b/src/lib.rs index 18dfbde..e12773a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -90,21 +90,21 @@ use std::{ }; use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt}; +use flate2::Compression; use flate2::read::ZlibDecoder; use flate2::write::ZlibEncoder; -use flate2::Compression; use crate::{ cursor_ext::{ReadExt, WriteExt}, custom_version::FCustomVersion, engine_version::FEngineVersion, error::{DeserializeError, Error}, - game_version::{DeserializedGameVersion, GameVersion, PalworldCompressionType, PLZ_MAGIC}, + game_version::{DeserializedGameVersion, GameVersion, PLZ_MAGIC, PalworldCompressionType}, object_version::EUnrealEngineObjectUE5Version, ord_ext::OrdExt, properties::{Property, PropertyOptions, PropertyTrait}, savegame_version::SaveGameVersion, - types::{map::HashableIndexMap, Guid}, + types::{Guid, map::HashableIndexMap}, }; /// The four bytes 'GVAS' appear at the beginning of every GVAS file. diff --git a/src/properties/array_property.rs b/src/properties/array_property.rs index 9ae74a1..9977e3e 100644 --- a/src/properties/array_property.rs +++ b/src/properties/array_property.rs @@ -13,13 +13,13 @@ use crate::{ }; use super::{ + Property, PropertyOptions, PropertyTrait, enum_property::EnumProperty, impl_read_header, impl_write, impl_write_header_part, int_property::{BoolProperty, ByteProperty, BytePropertyValue, FloatProperty, IntProperty}, name_property::NameProperty, str_property::StrProperty, struct_property::{StructProperty, StructPropertyValue}, - Property, PropertyOptions, PropertyTrait, }; #[cfg(feature = "serde")] diff --git a/src/properties/delegate_property.rs b/src/properties/delegate_property.rs index 8b1a79c..8f8e0df 100644 --- a/src/properties/delegate_property.rs +++ b/src/properties/delegate_property.rs @@ -7,7 +7,7 @@ use crate::{ error::Error, }; -use super::{impl_read, impl_read_header, impl_write, PropertyOptions, PropertyTrait}; +use super::{PropertyOptions, PropertyTrait, impl_read, impl_read_header, impl_write}; /// An Unreal script delegate #[derive(Debug, Clone, PartialEq, Eq, Hash)] diff --git a/src/properties/enum_property.rs b/src/properties/enum_property.rs index 01eae31..33693f6 100644 --- a/src/properties/enum_property.rs +++ b/src/properties/enum_property.rs @@ -7,7 +7,7 @@ use crate::{ error::Error, }; -use super::{impl_read_header, impl_write, impl_write_header_part, PropertyOptions, PropertyTrait}; +use super::{PropertyOptions, PropertyTrait, impl_read_header, impl_write, impl_write_header_part}; /// A property that holds an enum value. #[derive(Debug, Clone, PartialEq, Eq, Hash)] diff --git a/src/properties/field_path_property.rs b/src/properties/field_path_property.rs index 8351183..0579ad1 100644 --- a/src/properties/field_path_property.rs +++ b/src/properties/field_path_property.rs @@ -7,7 +7,7 @@ use crate::{ error::Error, }; -use super::{impl_read, impl_read_header, impl_write, PropertyOptions, PropertyTrait}; +use super::{PropertyOptions, PropertyTrait, impl_read, impl_read_header, impl_write}; /// Field path #[derive(Debug, Clone, PartialEq, Eq, Hash)] diff --git a/src/properties/int_property.rs b/src/properties/int_property.rs index 40259d3..ab4f7e4 100644 --- a/src/properties/int_property.rs +++ b/src/properties/int_property.rs @@ -7,9 +7,8 @@ use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt}; use ordered_float::OrderedFloat; use super::{ - impl_write, + PropertyOptions, PropertyTrait, impl_write, struct_types::{unwrap_value, wrap_type, wrap_value}, - PropertyOptions, PropertyTrait, }; use crate::{ cursor_ext::{ReadExt, WriteExt}, diff --git a/src/properties/map_property.rs b/src/properties/map_property.rs index 87faedd..9ee6bb6 100644 --- a/src/properties/map_property.rs +++ b/src/properties/map_property.rs @@ -9,12 +9,12 @@ use crate::{ cursor_ext::{ReadExt, WriteExt}, error::{DeserializeError, Error}, properties::{ + Property, PropertyOptions, PropertyTrait, enum_property::EnumProperty, impl_read_header, impl_write, impl_write_header_part, int_property::{BoolProperty, IntProperty}, name_property::NameProperty, str_property::StrProperty, - Property, PropertyOptions, PropertyTrait, }, scoped_stack_entry::ScopedStackEntry, types::map::HashableIndexMap, diff --git a/src/properties/mod.rs b/src/properties/mod.rs index 0f1321f..963f515 100644 --- a/src/properties/mod.rs +++ b/src/properties/mod.rs @@ -11,7 +11,7 @@ use crate::{ custom_version::{CustomVersionTrait, FCustomVersion}, error::{DeserializeError, Error}, scoped_stack_entry::ScopedStackEntry, - types::{map::HashableIndexMap, Guid}, + types::{Guid, map::HashableIndexMap}, }; use self::{ @@ -22,8 +22,8 @@ use self::{ enum_property::EnumProperty, field_path_property::FieldPathProperty, int_property::{ - BoolProperty, ByteProperty, DoubleProperty, FloatProperty, Int16Property, Int64Property, - Int8Property, IntProperty, UInt16Property, UInt32Property, UInt64Property, + BoolProperty, ByteProperty, DoubleProperty, FloatProperty, Int8Property, Int16Property, + Int64Property, IntProperty, UInt16Property, UInt32Property, UInt64Property, }, map_property::MapProperty, name_property::NameProperty, diff --git a/src/properties/name_property.rs b/src/properties/name_property.rs index 3d2212a..f695574 100644 --- a/src/properties/name_property.rs +++ b/src/properties/name_property.rs @@ -4,7 +4,7 @@ use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt}; use crate::{cursor_ext::ReadExt, cursor_ext::WriteExt, error::Error}; -use super::{impl_read, impl_read_header, impl_write, PropertyOptions, PropertyTrait}; +use super::{PropertyOptions, PropertyTrait, impl_read, impl_read_header, impl_write}; /// A property that holds a name. #[derive(Debug, Clone, PartialEq, Eq, Hash)] diff --git a/src/properties/object_property.rs b/src/properties/object_property.rs index 52fdaeb..0056bcf 100644 --- a/src/properties/object_property.rs +++ b/src/properties/object_property.rs @@ -7,7 +7,7 @@ use crate::{ error::Error, }; -use super::{impl_read, impl_read_header, impl_write, PropertyOptions, PropertyTrait}; +use super::{PropertyOptions, PropertyTrait, impl_read, impl_read_header, impl_write}; /// A property that describes a reference variable to another object which may be nil. #[derive(Debug, Clone, PartialEq, Eq, Hash)] diff --git a/src/properties/set_property.rs b/src/properties/set_property.rs index d528ddf..f677b88 100644 --- a/src/properties/set_property.rs +++ b/src/properties/set_property.rs @@ -8,7 +8,7 @@ use crate::{ }; use super::{ - impl_read_header, impl_write, impl_write_header_part, Property, PropertyOptions, PropertyTrait, + Property, PropertyOptions, PropertyTrait, impl_read_header, impl_write, impl_write_header_part, }; /// A property that stores a set of properties. diff --git a/src/properties/str_property.rs b/src/properties/str_property.rs index ca9697a..2737122 100644 --- a/src/properties/str_property.rs +++ b/src/properties/str_property.rs @@ -7,7 +7,7 @@ use crate::{ error::Error, }; -use super::{impl_read, impl_read_header, impl_write, PropertyOptions, PropertyTrait}; +use super::{PropertyOptions, PropertyTrait, impl_read, impl_read_header, impl_write}; /// A property that holds a GVAS string value. #[derive(Debug, Clone, PartialEq, Eq, Hash)] diff --git a/src/properties/struct_property.rs b/src/properties/struct_property.rs index 3b641d6..7746a84 100644 --- a/src/properties/struct_property.rs +++ b/src/properties/struct_property.rs @@ -13,16 +13,15 @@ use crate::{ error::{DeserializeError, Error, SerializeError}, properties::{name_property::NameProperty, struct_types::LinearColor}, scoped_stack_entry::ScopedStackEntry, - types::{map::HashableIndexMap, Guid}, + types::{Guid, map::HashableIndexMap}, }; use super::{ - impl_write, impl_write_header_part, make_matcher, + Property, PropertyOptions, PropertyTrait, impl_write, impl_write_header_part, make_matcher, struct_types::{ DateTime, IntPoint, QuatD, QuatF, RotatorD, RotatorF, Timespan, Vector2D, Vector2F, VectorD, VectorF, }, - Property, PropertyOptions, PropertyTrait, }; macro_rules! validate { diff --git a/src/properties/text_property.rs b/src/properties/text_property.rs index 970d8be..fb2689b 100644 --- a/src/properties/text_property.rs +++ b/src/properties/text_property.rs @@ -17,7 +17,7 @@ use crate::{ error::Error, }; -use super::{impl_read, impl_read_header, impl_write, PropertyOptions, PropertyTrait}; +use super::{PropertyOptions, PropertyTrait, impl_read, impl_read_header, impl_write}; /// A property that stores GVAS Text. #[derive(Debug, Clone, PartialEq, Eq, Hash)] diff --git a/tests/common/delegate.rs b/tests/common/delegate.rs index 0707897..cb05697 100644 --- a/tests/common/delegate.rs +++ b/tests/common/delegate.rs @@ -1,15 +1,15 @@ use gvas::{ + GvasFile, GvasHeader, engine_version::FEngineVersion, game_version::DeserializedGameVersion, properties::{ + Property, delegate_property::{ Delegate, DelegateProperty, MulticastInlineDelegateProperty, MulticastScriptDelegate, MulticastSparseDelegateProperty, }, - Property, }, - types::{map::HashableIndexMap, Guid}, - GvasFile, GvasHeader, + types::{Guid, map::HashableIndexMap}, }; use std::str::FromStr; diff --git a/tests/common/options.rs b/tests/common/options.rs index 2eda316..087b3f0 100644 --- a/tests/common/options.rs +++ b/tests/common/options.rs @@ -1,9 +1,9 @@ use gvas::{ + GvasFile, GvasHeader, engine_version::FEngineVersion, game_version::DeserializedGameVersion, - properties::{int_property::FloatProperty, Property}, - types::{map::HashableIndexMap, Guid}, - GvasFile, GvasHeader, + properties::{Property, int_property::FloatProperty}, + types::{Guid, map::HashableIndexMap}, }; use std::str::FromStr; diff --git a/tests/common/palworld.rs b/tests/common/palworld.rs index 66d93f3..65e0c18 100644 --- a/tests/common/palworld.rs +++ b/tests/common/palworld.rs @@ -1,80 +1,144 @@ use std::collections::HashMap; pub(crate) fn hints() -> HashMap { - HashMap::from([( - String::from( - "worldSaveData.StructProperty.CharacterSaveParameterMap.MapProperty.Key.StructProperty", - ), - String::from("StructProperty"), - ), ( - String::from( - "worldSaveData.StructProperty.CharacterSaveParameterMap.MapProperty.Value.StructProperty", - ), - String::from("StructProperty"), - ), ( - String::from( - "worldSaveData.StructProperty.MapObjectSaveData.ArrayProperty.ConcreteModel.StructProperty.ModuleMap.MapProperty.Value.StructProperty", - ), - String::from("StructProperty"), - ), ( - String::from("worldSaveData.StructProperty.FoliageGridSaveDataMap.MapProperty.Key.StructProperty"), - String::from("StructProperty"), - ), ( - String::from("worldSaveData.StructProperty.FoliageGridSaveDataMap.MapProperty.Value.StructProperty"), - String::from("StructProperty"), - ), ( - String::from("worldSaveData.StructProperty.FoliageGridSaveDataMap.MapProperty.Value.StructProperty.ModelMap.MapProperty.Value.StructProperty"), - String::from("StructProperty") - ), ( - String::from("worldSaveData.StructProperty.FoliageGridSaveDataMap.MapProperty.Value.StructProperty.ModelMap.MapProperty.Value.StructProperty.InstanceDataMap.MapProperty.Key.StructProperty"), - String::from("StructProperty") - ), ( - String::from("worldSaveData.StructProperty.FoliageGridSaveDataMap.MapProperty.Value.StructProperty.ModelMap.MapProperty.Value.StructProperty.InstanceDataMap.MapProperty.Value.StructProperty"), - String::from("StructProperty") - ), ( - String::from("worldSaveData.StructProperty.MapObjectSpawnerInStageSaveData.MapProperty.Key.StructProperty"), - String::from("StructProperty") - ), ( - String::from("worldSaveData.StructProperty.MapObjectSpawnerInStageSaveData.MapProperty.Value.StructProperty"), - String::from("StructProperty") - ), ( - String::from("worldSaveData.StructProperty.MapObjectSpawnerInStageSaveData.MapProperty.Value.StructProperty.SpawnerDataMapByLevelObjectInstanceId.MapProperty.Key.StructProperty"), - String::from("Guid") - ), ( - String::from("worldSaveData.StructProperty.MapObjectSpawnerInStageSaveData.MapProperty.Value.StructProperty.SpawnerDataMapByLevelObjectInstanceId.MapProperty.Value.StructProperty"), - String::from("StructProperty") - ), ( - String::from("worldSaveData.StructProperty.MapObjectSpawnerInStageSaveData.MapProperty.Value.StructProperty.SpawnerDataMapByLevelObjectInstanceId.MapProperty.Value.StructProperty.ItemMap.MapProperty.Value.StructProperty"), - String::from("StructProperty") - ), ( - String::from("worldSaveData.StructProperty.BaseCampSaveData.MapProperty.Key.StructProperty"), - String::from("Guid") - ), ( - String::from("worldSaveData.StructProperty.BaseCampSaveData.MapProperty.Value.StructProperty"), - String::from("StructProperty") - ), ( - String::from("worldSaveData.StructProperty.BaseCampSaveData.MapProperty.Value.StructProperty.ModuleMap.MapProperty.Value.StructProperty"), - String::from("StructProperty") - ), ( - String::from("worldSaveData.StructProperty.ItemContainerSaveData.MapProperty.Key.StructProperty"), - String::from("StructProperty") - ), ( - String::from("worldSaveData.StructProperty.ItemContainerSaveData.MapProperty.Value.StructProperty"), - String::from("StructProperty") - ), ( - String::from("worldSaveData.StructProperty.CharacterContainerSaveData.MapProperty.Key.StructProperty"), - String::from("StructProperty") - ), ( - String::from("worldSaveData.StructProperty.CharacterContainerSaveData.MapProperty.Value.StructProperty"), - String::from("StructProperty") - ), ( - String::from("worldSaveData.StructProperty.GroupSaveDataMap.MapProperty.Key.StructProperty"), - String::from("Guid") - ), ( - String::from("worldSaveData.StructProperty.GroupSaveDataMap.MapProperty.Value.StructProperty"), - String::from("StructProperty") - ), ( - String::from("worldSaveData.StructProperty.EnemyCampSaveData.StructProperty.EnemyCampStatusMap.MapProperty.Value.StructProperty"), - String::from("StructProperty") - )]) + HashMap::from([ + ( + String::from( + "worldSaveData.StructProperty.CharacterSaveParameterMap.MapProperty.Key.StructProperty", + ), + String::from("StructProperty"), + ), + ( + String::from( + "worldSaveData.StructProperty.CharacterSaveParameterMap.MapProperty.Value.StructProperty", + ), + String::from("StructProperty"), + ), + ( + String::from( + "worldSaveData.StructProperty.MapObjectSaveData.ArrayProperty.ConcreteModel.StructProperty.ModuleMap.MapProperty.Value.StructProperty", + ), + String::from("StructProperty"), + ), + ( + String::from( + "worldSaveData.StructProperty.FoliageGridSaveDataMap.MapProperty.Key.StructProperty", + ), + String::from("StructProperty"), + ), + ( + String::from( + "worldSaveData.StructProperty.FoliageGridSaveDataMap.MapProperty.Value.StructProperty", + ), + String::from("StructProperty"), + ), + ( + String::from( + "worldSaveData.StructProperty.FoliageGridSaveDataMap.MapProperty.Value.StructProperty.ModelMap.MapProperty.Value.StructProperty", + ), + String::from("StructProperty"), + ), + ( + String::from( + "worldSaveData.StructProperty.FoliageGridSaveDataMap.MapProperty.Value.StructProperty.ModelMap.MapProperty.Value.StructProperty.InstanceDataMap.MapProperty.Key.StructProperty", + ), + String::from("StructProperty"), + ), + ( + String::from( + "worldSaveData.StructProperty.FoliageGridSaveDataMap.MapProperty.Value.StructProperty.ModelMap.MapProperty.Value.StructProperty.InstanceDataMap.MapProperty.Value.StructProperty", + ), + String::from("StructProperty"), + ), + ( + String::from( + "worldSaveData.StructProperty.MapObjectSpawnerInStageSaveData.MapProperty.Key.StructProperty", + ), + String::from("StructProperty"), + ), + ( + String::from( + "worldSaveData.StructProperty.MapObjectSpawnerInStageSaveData.MapProperty.Value.StructProperty", + ), + String::from("StructProperty"), + ), + ( + String::from( + "worldSaveData.StructProperty.MapObjectSpawnerInStageSaveData.MapProperty.Value.StructProperty.SpawnerDataMapByLevelObjectInstanceId.MapProperty.Key.StructProperty", + ), + String::from("Guid"), + ), + ( + String::from( + "worldSaveData.StructProperty.MapObjectSpawnerInStageSaveData.MapProperty.Value.StructProperty.SpawnerDataMapByLevelObjectInstanceId.MapProperty.Value.StructProperty", + ), + String::from("StructProperty"), + ), + ( + String::from( + "worldSaveData.StructProperty.MapObjectSpawnerInStageSaveData.MapProperty.Value.StructProperty.SpawnerDataMapByLevelObjectInstanceId.MapProperty.Value.StructProperty.ItemMap.MapProperty.Value.StructProperty", + ), + String::from("StructProperty"), + ), + ( + String::from( + "worldSaveData.StructProperty.BaseCampSaveData.MapProperty.Key.StructProperty", + ), + String::from("Guid"), + ), + ( + String::from( + "worldSaveData.StructProperty.BaseCampSaveData.MapProperty.Value.StructProperty", + ), + String::from("StructProperty"), + ), + ( + String::from( + "worldSaveData.StructProperty.BaseCampSaveData.MapProperty.Value.StructProperty.ModuleMap.MapProperty.Value.StructProperty", + ), + String::from("StructProperty"), + ), + ( + String::from( + "worldSaveData.StructProperty.ItemContainerSaveData.MapProperty.Key.StructProperty", + ), + String::from("StructProperty"), + ), + ( + String::from( + "worldSaveData.StructProperty.ItemContainerSaveData.MapProperty.Value.StructProperty", + ), + String::from("StructProperty"), + ), + ( + String::from( + "worldSaveData.StructProperty.CharacterContainerSaveData.MapProperty.Key.StructProperty", + ), + String::from("StructProperty"), + ), + ( + String::from( + "worldSaveData.StructProperty.CharacterContainerSaveData.MapProperty.Value.StructProperty", + ), + String::from("StructProperty"), + ), + ( + String::from( + "worldSaveData.StructProperty.GroupSaveDataMap.MapProperty.Key.StructProperty", + ), + String::from("Guid"), + ), + ( + String::from( + "worldSaveData.StructProperty.GroupSaveDataMap.MapProperty.Value.StructProperty", + ), + String::from("StructProperty"), + ), + ( + String::from( + "worldSaveData.StructProperty.EnemyCampSaveData.StructProperty.EnemyCampStatusMap.MapProperty.Value.StructProperty", + ), + String::from("StructProperty"), + ), + ]) } diff --git a/tests/common/saveslot3.rs b/tests/common/saveslot3.rs index 7247169..3c2cece 100644 --- a/tests/common/saveslot3.rs +++ b/tests/common/saveslot3.rs @@ -1,8 +1,10 @@ use std::{collections::HashMap, str::FromStr as _}; use gvas::{ + GvasFile, GvasHeader, engine_version::FEngineVersion, properties::{ + Property, field_path_property::{FieldPath, FieldPathProperty}, int_property::{FloatProperty, IntProperty}, map_property::MapProperty, @@ -11,10 +13,8 @@ use gvas::{ str_property::StrProperty, struct_property::{StructProperty, StructPropertyValue}, struct_types::DateTime, - Property, }, - types::{map::HashableIndexMap, Guid}, - GvasFile, GvasHeader, + types::{Guid, map::HashableIndexMap}, }; pub(crate) fn hints() -> HashMap { diff --git a/tests/common/slot1.rs b/tests/common/slot1.rs index 5fd429a..0625d95 100644 --- a/tests/common/slot1.rs +++ b/tests/common/slot1.rs @@ -1,20 +1,20 @@ use gvas::{ + GvasFile, GvasHeader, engine_version::FEngineVersion, game_version::DeserializedGameVersion, properties::{ + Property, array_property::ArrayProperty, int_property::{ - ByteProperty, BytePropertyValue, DoubleProperty, FloatProperty, Int16Property, - Int64Property, Int8Property, IntProperty, UInt16Property, UInt32Property, + ByteProperty, BytePropertyValue, DoubleProperty, FloatProperty, Int8Property, + Int16Property, Int64Property, IntProperty, UInt16Property, UInt32Property, UInt64Property, }, str_property::StrProperty, struct_property::{StructProperty, StructPropertyValue}, struct_types::DateTime, - Property, }, - types::{map::HashableIndexMap, Guid}, - GvasFile, GvasHeader, + types::{Guid, map::HashableIndexMap}, }; use std::str::FromStr; diff --git a/tests/common/vector2d.rs b/tests/common/vector2d.rs index 50c2d0a..98ebf7c 100644 --- a/tests/common/vector2d.rs +++ b/tests/common/vector2d.rs @@ -1,16 +1,16 @@ use gvas::{ + GvasFile, GvasHeader, engine_version::FEngineVersion, game_version::DeserializedGameVersion, properties::{ + Property, delegate_property::{Delegate, MulticastInlineDelegateProperty, MulticastScriptDelegate}, int_property::{BoolProperty, FloatProperty, IntProperty}, str_property::StrProperty, struct_property::{StructProperty, StructPropertyValue}, struct_types::Vector2D, - Property, }, - types::{map::HashableIndexMap, Guid}, - GvasFile, GvasHeader, + types::{Guid, map::HashableIndexMap}, }; use ordered_float::OrderedFloat; use std::str::FromStr; diff --git a/tests/gvas.rs b/tests/gvas.rs index 62b487c..6455b04 100644 --- a/tests/gvas.rs +++ b/tests/gvas.rs @@ -2,8 +2,8 @@ mod common; use common::*; mod gvas_tests; use gvas::{ - game_version::{DeserializedGameVersion, GameVersion, PalworldCompressionType}, GvasFile, + game_version::{DeserializedGameVersion, GameVersion, PalworldCompressionType}, }; use std::{collections::HashMap, fs, io::Cursor, path::Path}; diff --git a/tests/gvas_tests/errors.rs b/tests/gvas_tests/errors.rs index 667f1b1..f71a45f 100644 --- a/tests/gvas_tests/errors.rs +++ b/tests/gvas_tests/errors.rs @@ -1,12 +1,12 @@ use gvas::{ + GvasFile, error::{DeserializeError, Error}, game_version::GameVersion, properties::{ - array_property::ArrayProperty, enum_property::EnumProperty, map_property::MapProperty, - set_property::SetProperty, str_property::StrProperty, PropertyOptions, + PropertyOptions, array_property::ArrayProperty, enum_property::EnumProperty, + map_property::MapProperty, set_property::SetProperty, str_property::StrProperty, }, types::map::HashableIndexMap, - GvasFile, }; use std::{collections::HashMap, io::Cursor}; diff --git a/tests/gvas_tests/name_arrayindex.rs b/tests/gvas_tests/name_arrayindex.rs index 3dc928a..a2f0b6d 100644 --- a/tests/gvas_tests/name_arrayindex.rs +++ b/tests/gvas_tests/name_arrayindex.rs @@ -1,5 +1,5 @@ use gvas::cursor_ext::ReadExt; -use gvas::properties::{name_property::NameProperty, PropertyOptions, PropertyTrait}; +use gvas::properties::{PropertyOptions, PropertyTrait, name_property::NameProperty}; use gvas::types::map::HashableIndexMap; use std::collections::HashMap; use std::io::Cursor; diff --git a/tests/gvas_tests/package_version_524.rs b/tests/gvas_tests/package_version_524.rs index 4a80336..214dc58 100644 --- a/tests/gvas_tests/package_version_524.rs +++ b/tests/gvas_tests/package_version_524.rs @@ -1,6 +1,6 @@ use crate::common::PACKAGE_VERSION_524_PATH; -use gvas::game_version::GameVersion; use gvas::GvasFile; +use gvas::game_version::GameVersion; use std::{ fs::File, io::{Cursor, Read}, diff --git a/tests/gvas_tests/package_version_525.rs b/tests/gvas_tests/package_version_525.rs index 9ff2500..18266a8 100644 --- a/tests/gvas_tests/package_version_525.rs +++ b/tests/gvas_tests/package_version_525.rs @@ -1,6 +1,6 @@ use crate::common::PACKAGE_VERSION_525_PATH; -use gvas::game_version::GameVersion; use gvas::GvasFile; +use gvas::game_version::GameVersion; use std::fs::File; use std::io::{Cursor, Read}; use std::path::Path; diff --git a/tests/gvas_tests/test_file.rs b/tests/gvas_tests/test_file.rs index e04c941..c17d425 100644 --- a/tests/gvas_tests/test_file.rs +++ b/tests/gvas_tests/test_file.rs @@ -3,7 +3,7 @@ use std::io::Cursor; use byteorder::{LittleEndian, WriteBytesExt}; use gvas::game_version::GameVersion; -use gvas::{error::Error, GvasFile, GvasHeader, FILE_TYPE_GVAS}; +use gvas::{FILE_TYPE_GVAS, GvasFile, GvasHeader, error::Error}; #[test] fn test_file_err() { diff --git a/tests/gvas_tests/test_property.rs b/tests/gvas_tests/test_property.rs index 1f61c60..4ff236d 100644 --- a/tests/gvas_tests/test_property.rs +++ b/tests/gvas_tests/test_property.rs @@ -3,11 +3,12 @@ use std::{collections::HashMap, io::Cursor}; use gvas::{ cursor_ext::ReadExt, properties::{ + Property, PropertyOptions, PropertyTrait, array_property::ArrayProperty, enum_property::EnumProperty, int_property::{ BoolProperty, ByteProperty, BytePropertyValue, DoubleProperty, FloatProperty, - Int16Property, Int64Property, Int8Property, IntProperty, UInt16Property, + Int8Property, Int16Property, Int64Property, IntProperty, UInt16Property, UInt32Property, UInt64Property, }, map_property::MapProperty, @@ -16,9 +17,8 @@ use gvas::{ struct_property::{StructProperty, StructPropertyValue}, struct_types::VectorF, text_property::TextProperty, - Property, PropertyOptions, PropertyTrait, }, - types::{map::HashableIndexMap, Guid}, + types::{Guid, map::HashableIndexMap}, }; use gvas::properties::text_property::FText; diff --git a/tests/serde_tests/serde_json_round_trip.rs b/tests/serde_tests/serde_json_round_trip.rs index 3fe9a74..c656b45 100644 --- a/tests/serde_tests/serde_json_round_trip.rs +++ b/tests/serde_tests/serde_json_round_trip.rs @@ -1,5 +1,5 @@ use crate::common::*; -use gvas::{game_version::GameVersion, GvasFile}; +use gvas::{GvasFile, game_version::GameVersion}; use std::{collections::HashMap, fs::File, path::Path}; fn test_file_with_hints(path: &str, hints: &HashMap) { diff --git a/tests/serde_tests/serde_json_template.rs b/tests/serde_tests/serde_json_template.rs index 8b71502..25069d3 100644 --- a/tests/serde_tests/serde_json_template.rs +++ b/tests/serde_tests/serde_json_template.rs @@ -1,14 +1,16 @@ use crate::common::*; use gvas::{ + GvasFile, game_version::GameVersion, properties::{ + Property, array_property::ArrayProperty, delegate_property::{Delegate, DelegateProperty}, enum_property::EnumProperty, field_path_property::{FieldPath, FieldPathProperty}, int_property::{ BoolProperty, ByteProperty, BytePropertyValue, DoubleProperty, FloatProperty, - Int16Property, Int64Property, Int8Property, IntProperty, UInt16Property, + Int8Property, Int16Property, Int64Property, IntProperty, UInt16Property, UInt32Property, UInt64Property, }, map_property::MapProperty, @@ -26,10 +28,8 @@ use gvas::{ RoundingMode, TextProperty, TransformType, }, unknown_property::UnknownProperty, - Property, }, - types::{map::HashableIndexMap, Guid}, - GvasFile, + types::{Guid, map::HashableIndexMap}, }; use serde::{Deserialize, Serialize}; use std::{