diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-03-14 00:17:02 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-03-14 00:17:02 +0800 |
| commit | 709629d5d3ab856d9711aedbe32ceaafac5369af (patch) | |
| tree | 98be25d144bd2c451c5c3dc0df215c7b010db9d9 /systems/sheet | |
| parent | d213a4258ff6dd3475dbde8c98440735bade19fd (diff) | |
Add framework system and refactor module exports
Diffstat (limited to 'systems/sheet')
| -rw-r--r-- | systems/sheet/src/sheet.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/systems/sheet/src/sheet.rs b/systems/sheet/src/sheet.rs index 5ee2db7..cca2450 100644 --- a/systems/sheet/src/sheet.rs +++ b/systems/sheet/src/sheet.rs @@ -552,9 +552,7 @@ impl TryFrom<&[u8]> for SheetData { } impl RWData<SheetData> for SheetData { - type DataType = SheetData; - - async fn read(path: &PathBuf) -> Result<Self::DataType, asset_system::error::DataReadError> { + async fn read(path: &PathBuf) -> Result<SheetData, asset_system::error::DataReadError> { let read_data = SheetData::full_read(&mut SheetData::empty(), path).await; match read_data { Ok(_) => { @@ -573,7 +571,7 @@ impl RWData<SheetData> for SheetData { } async fn write( - data: Self::DataType, + data: SheetData, path: &PathBuf, ) -> Result<(), asset_system::error::DataWriteError> { let write_data = tokio::fs::write(path, data.as_bytes()).await; @@ -585,7 +583,7 @@ impl RWData<SheetData> for SheetData { } } - fn test_data() -> Self::DataType { + fn test_data() -> SheetData { let sheet = SheetData::empty().pack("sheet"); let mut sheet = sheet; sheet @@ -601,7 +599,7 @@ impl RWData<SheetData> for SheetData { sheet.unpack() } - fn verify_data(data_a: Self::DataType, data_b: Self::DataType) -> bool { + fn verify_data(data_a: SheetData, data_b: SheetData) -> bool { data_a == data_b } } |
