浏览代码

chore(deps): update state to 0.6 (#7252)

Lucas Fernandes Nogueira 2 年之前
父节点
当前提交
d1a6e2f333
共有 3 个文件被更改,包括 9 次插入4 次删除
  1. 5 0
      .changes/state-0.6.md
  2. 1 1
      core/tauri/Cargo.toml
  3. 3 3
      core/tauri/src/state.rs

+ 5 - 0
.changes/state-0.6.md

@@ -0,0 +1,5 @@
+---
+"tauri": patch:deps
+---
+
+Update `state` to v0.6.

+ 1 - 1
core/tauri/Cargo.toml

@@ -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"

+ 3 - 3
core/tauri/src/state.rs

@@ -6,7 +6,7 @@ use crate::{
   command::{CommandArg, CommandItem},
   InvokeError, Runtime,
 };
-use state::Container;
+use state::TypeMap;
 
 /// A guard for a state value.
 ///
@@ -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 {