Evan Almloff 1 سال پیش
والد
کامیت
a96ccdc6f3
3فایلهای تغییر یافته به همراه4 افزوده شده و 10 حذف شده
  1. 2 2
      packages/core/src/scopes.rs
  2. 1 1
      packages/liveview/src/pool.rs
  3. 1 7
      packages/signals/src/lib.rs

+ 2 - 2
packages/core/src/scopes.rs

@@ -688,13 +688,13 @@ impl<'src> ScopeState {
                 raw_ref.downcast_mut::<State>()
                 raw_ref.downcast_mut::<State>()
             })
             })
             .expect(
             .expect(
-                r###"
+                r#"
                 Unable to retrieve the hook that was initialized at this index.
                 Unable to retrieve the hook that was initialized at this index.
                 Consult the `rules of hooks` to understand how to use hooks properly.
                 Consult the `rules of hooks` to understand how to use hooks properly.
 
 
                 You likely used the hook in a conditional. Hooks rely on consistent ordering between renders.
                 You likely used the hook in a conditional. Hooks rely on consistent ordering between renders.
                 Functions prefixed with "use" should never be called conditionally.
                 Functions prefixed with "use" should never be called conditionally.
-                "###,
+                "#,
             )
             )
     }
     }
 }
 }

+ 1 - 1
packages/liveview/src/pool.rs

@@ -160,7 +160,7 @@ pub async fn run(mut vdom: VirtualDom, ws: impl LiveViewSocket) -> Result<(), Li
                         ws.send(b"__pong__".to_vec()).await?;
                         ws.send(b"__pong__".to_vec()).await?;
                     }
                     }
                     Some(Ok(evt)) => {
                     Some(Ok(evt)) => {
-                        if let Ok(message) = serde_json::from_str::<IpcMessage>(&*String::from_utf8_lossy(evt)) {
+                        if let Ok(message) = serde_json::from_str::<IpcMessage>(&String::from_utf8_lossy(evt)) {
                             match message {
                             match message {
                                 IpcMessage::Event(evt) => {
                                 IpcMessage::Event(evt) => {
                                     // Intercept the mounted event and insert a custom element type
                                     // Intercept the mounted event and insert a custom element type

+ 1 - 7
packages/signals/src/lib.rs

@@ -10,8 +10,6 @@ mod rt;
 use dioxus_core::ScopeState;
 use dioxus_core::ScopeState;
 pub use rt::*;
 pub use rt::*;
 
 
-use crate::rt::claim_rt;
-
 pub fn use_init_signal_rt(cx: &ScopeState) {
 pub fn use_init_signal_rt(cx: &ScopeState) {
     cx.use_hook(|| {
     cx.use_hook(|| {
         let rt = claim_rt(cx.schedule_update_any());
         let rt = claim_rt(cx.schedule_update_any());
@@ -96,11 +94,7 @@ impl<T: Clone + 'static> std::ops::Deref for Signal<T> {
 
 
 impl<T> std::clone::Clone for Signal<T> {
 impl<T> std::clone::Clone for Signal<T> {
     fn clone(&self) -> Self {
     fn clone(&self) -> Self {
-        Self {
-            t: PhantomData,
-            id: self.id,
-            rt: self.rt,
-        }
+        *self
     }
     }
 }
 }