Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update state to 0.6 #7252

Merged
merged 1 commit into from
Jun 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/state-0.6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tauri": patch:deps
---

Update `state` to v0.6.
2 changes: 1 addition & 1 deletion core/tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ tauri-runtime-wry = { version = "0.13.0-alpha.6", path = "../tauri-runtime-wry",
rand = "0.8"
semver = { version = "1.0", features = [ "serde" ] }
serde_repr = "0.1"
state = "0.5"
state = "0.6"
tempfile = "3"
http = "0.2"
dirs-next = "2.0"
Expand Down
6 changes: 3 additions & 3 deletions core/tauri/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::{
command::{CommandArg, CommandItem},
InvokeError, Runtime,
};
use state::Container;
use state::TypeMap;

/// A guard for a state value.
///
Expand Down Expand Up @@ -58,11 +58,11 @@ impl<'r, 'de: 'r, T: Send + Sync + 'static, R: Runtime> CommandArg<'de, R> for S

/// The Tauri state manager.
#[derive(Debug)]
pub struct StateManager(pub(crate) Container![Send + Sync]);
pub struct StateManager(pub(crate) TypeMap![Send + Sync]);

impl StateManager {
pub(crate) fn new() -> Self {
Self(<Container![Send + Sync]>::new())
Self(<TypeMap![Send + Sync]>::new())
}

pub(crate) fn set<T: Send + Sync + 'static>(&self, state: T) -> bool {
Expand Down