From 985059a1f0cf0dd1c49f5e5fde4f4ab1c4b341f0 Mon Sep 17 00:00:00 2001 From: Tony Date: Tue, 15 Oct 2024 22:52:11 +0800 Subject: [PATCH] Don't make StoreState public --- plugins/store/README.md | 2 +- plugins/store/src/lib.rs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/store/README.md b/plugins/store/README.md index 5b60fcd2..f6773776 100644 --- a/plugins/store/README.md +++ b/plugins/store/README.md @@ -123,7 +123,7 @@ fn main() { .plugin(tauri_plugin_store::Builder::default().build()) .setup(|app| { // This loads the store from disk - let store = app.store("app_data.json"); + let store = app.store("app_data.json")?; // Note that values must be serde_json::Value instances, // otherwise, they will not be compatible with the JavaScript bindings. diff --git a/plugins/store/src/lib.rs b/plugins/store/src/lib.rs index e44e2d3e..b1f06d3d 100644 --- a/plugins/store/src/lib.rs +++ b/plugins/store/src/lib.rs @@ -41,7 +41,7 @@ struct ChangePayload<'a> { } #[derive(Debug)] -pub struct StoreState { +struct StoreState { stores: Arc>>, serialize_fns: HashMap, deserialize_fns: HashMap, @@ -327,7 +327,6 @@ pub trait StoreExt { impl> StoreExt for T { fn store(&self, path: impl AsRef) -> Result>> { - let path = path.as_ref(); StoreBuilder::new(self.app_handle(), path).new_or_existing() }