fix clippy

This commit is contained in:
Evan Almloff 2023-07-18 13:16:17 -07:00
parent 8188011fe3
commit a96ccdc6f3
3 changed files with 4 additions and 10 deletions

View file

@ -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.
"###, "#,
) )
} }
} }

View file

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

View file

@ -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 { *self
t: PhantomData,
id: self.id,
rt: self.rt,
}
} }
} }