From 709629d5d3ab856d9711aedbe32ceaafac5369af Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sat, 14 Mar 2026 00:17:02 +0800 Subject: Add framework system and refactor module exports --- systems/vault/src/vault.rs | 2 +- systems/vault/src/vault/config.rs | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'systems/vault/src') diff --git a/systems/vault/src/vault.rs b/systems/vault/src/vault.rs index 262f8c5..fa3f9b5 100644 --- a/systems/vault/src/vault.rs +++ b/systems/vault/src/vault.rs @@ -3,7 +3,7 @@ use constants::vault::{ dirs::{vault_dir_changes, vault_dir_ignore_rules, vault_dir_member_root, vault_dir_refsheets}, files::vault_file_config, }; -use framework::{SpaceRootTest, space::SpaceRoot}; +use framework::{space::SpaceRoot, space_macro::SpaceRootTest}; use tokio::fs; use crate::vault::config::VaultConfig; diff --git a/systems/vault/src/vault/config.rs b/systems/vault/src/vault/config.rs index 7c4db70..329f78e 100644 --- a/systems/vault/src/vault/config.rs +++ b/systems/vault/src/vault/config.rs @@ -6,11 +6,9 @@ use serde::{Deserialize, Serialize}; pub struct VaultConfig {} impl RWData for VaultConfig { - type DataType = VaultConfig; - async fn read( path: &std::path::PathBuf, - ) -> Result { + ) -> Result { let read_config = read_config(path).await; match read_config { Ok(config) => Ok(config), @@ -21,7 +19,7 @@ impl RWData for VaultConfig { } async fn write( - data: Self::DataType, + data: VaultConfig, path: &std::path::PathBuf, ) -> Result<(), asset_system::error::DataWriteError> { let write_config = write_config(path, &data).await; @@ -35,11 +33,11 @@ impl RWData for VaultConfig { } } - fn test_data() -> Self::DataType { + fn test_data() -> VaultConfig { VaultConfig::default() } - fn verify_data(data_a: Self::DataType, data_b: Self::DataType) -> bool { + fn verify_data(data_a: VaultConfig, data_b: VaultConfig) -> bool { &data_a == &data_b } } -- cgit