Skip to content

Commit

Permalink
Don't make StoreState public
Browse files Browse the repository at this point in the history
  • Loading branch information
Legend-Master committed Oct 15, 2024
1 parent 5f2de5e commit 985059a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugins/store/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions plugins/store/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ struct ChangePayload<'a> {
}

#[derive(Debug)]
pub struct StoreState {
struct StoreState {
stores: Arc<Mutex<HashMap<PathBuf, ResourceId>>>,
serialize_fns: HashMap<String, SerializeFn>,
deserialize_fns: HashMap<String, DeserializeFn>,
Expand Down Expand Up @@ -327,7 +327,6 @@ pub trait StoreExt<R: Runtime> {

impl<R: Runtime, T: Manager<R>> StoreExt<R> for T {
fn store(&self, path: impl AsRef<Path>) -> Result<Arc<Store<R>>> {
let path = path.as_ref();
StoreBuilder::new(self.app_handle(), path).new_or_existing()
}

Expand Down

0 comments on commit 985059a

Please sign in to comment.