fix lints
This commit is contained in:
1 parent
4c1fe1d9bb
commit
db7a1ec0b0
5 files changed
+3
-12
No files matched your search
@@ -862,10 +862,7 @@ impl<'b> VirtualDom {
|
|||||||
let scope = comp.scope.take().unwrap();
|
let scope = comp.scope.take().unwrap();
|
||||||
|
|
||||||
match unsafe { self.scopes[scope.0].root_node().extend_lifetime_ref() } {
|
match unsafe { self.scopes[scope.0].root_node().extend_lifetime_ref() } {
|
||||||
RenderReturn::Sync(Some(t)) => {
|
RenderReturn::Sync(Some(t)) => self.remove_node(t, gen_muts),
|
||||||
println!("Removing component node sync {:?}", gen_muts);
|
|
||||||
self.remove_node(t, gen_muts)
|
|
||||||
}
|
|
||||||
_ => todo!("cannot handle nonstandard nodes"),
|
_ => todo!("cannot handle nonstandard nodes"),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
//! Convert a serialized event to an event trigger
|
//! Convert a serialized event to an event trigger
|
||||||
|
|
||||||
use dioxus_html::*;
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Deserialize, Serialize)]
|
#[derive(Deserialize, Serialize)]
|
||||||
|
|||||||
@@ -188,7 +188,6 @@ impl<'a, Ctx: HotReloadingContext> ToTokens for TemplateRenderer<'a, Ctx> {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Render and release the mutable borrow on context
|
// Render and release the mutable borrow on context
|
||||||
let num_roots = self.roots.len();
|
|
||||||
let roots = quote! { #( #root_printer ),* };
|
let roots = quote! { #( #root_printer ),* };
|
||||||
let node_printer = &context.dynamic_nodes;
|
let node_printer = &context.dynamic_nodes;
|
||||||
let dyn_attr_printer = &context.dynamic_attributes;
|
let dyn_attr_printer = &context.dynamic_attributes;
|
||||||
|
|||||||
@@ -18,10 +18,9 @@ pub(crate) fn init() -> UnboundedReceiver<Template<'static>> {
|
|||||||
|
|
||||||
#[cfg(debug_assertions)]
|
#[cfg(debug_assertions)]
|
||||||
pub(crate) fn init() -> UnboundedReceiver<Template<'static>> {
|
pub(crate) fn init() -> UnboundedReceiver<Template<'static>> {
|
||||||
|
use core::panic;
|
||||||
use std::convert::TryInto;
|
use std::convert::TryInto;
|
||||||
|
|
||||||
use web_sys::console;
|
|
||||||
|
|
||||||
let window = web_sys::window().unwrap();
|
let window = web_sys::window().unwrap();
|
||||||
|
|
||||||
let protocol = if window.location().protocol().unwrap() == "https:" {
|
let protocol = if window.location().protocol().unwrap() == "https:" {
|
||||||
@@ -44,10 +43,9 @@ pub(crate) fn init() -> UnboundedReceiver<Template<'static>> {
|
|||||||
if let Ok(text) = e.data().dyn_into::<js_sys::JsString>() {
|
if let Ok(text) = e.data().dyn_into::<js_sys::JsString>() {
|
||||||
let text: Result<String, _> = text.try_into();
|
let text: Result<String, _> = text.try_into();
|
||||||
if let Ok(string) = text {
|
if let Ok(string) = text {
|
||||||
console::log_1(&string.clone().into());
|
|
||||||
match serde_json::from_str(Box::leak(string.into_boxed_str())) {
|
match serde_json::from_str(Box::leak(string.into_boxed_str())) {
|
||||||
Ok(template) => _ = tx.unbounded_send(template),
|
Ok(template) => _ = tx.unbounded_send(template),
|
||||||
Err(e) => console::log_1(&e.to_string().into()),
|
Err(e) => panic!("Failed to parse template: {}", e),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,7 +57,6 @@ pub use crate::cfg::Config;
|
|||||||
pub use crate::util::{use_eval, EvalResult};
|
pub use crate::util::{use_eval, EvalResult};
|
||||||
use dioxus_core::{Element, Scope, VirtualDom};
|
use dioxus_core::{Element, Scope, VirtualDom};
|
||||||
use futures_util::{pin_mut, FutureExt, StreamExt};
|
use futures_util::{pin_mut, FutureExt, StreamExt};
|
||||||
use web_sys::console;
|
|
||||||
|
|
||||||
mod cache;
|
mod cache;
|
||||||
mod cfg;
|
mod cfg;
|
||||||
@@ -210,7 +209,6 @@ pub async fn run_with_props<T: 'static>(root: fn(Scope<T>) -> Element, root_prop
|
|||||||
futures_util::select! {
|
futures_util::select! {
|
||||||
_ = work => (None, None),
|
_ = work => (None, None),
|
||||||
new_template = hotreload_rx.next() => {
|
new_template = hotreload_rx.next() => {
|
||||||
console::log_1(&"hot reload".into());
|
|
||||||
(None, new_template)
|
(None, new_template)
|
||||||
}
|
}
|
||||||
evt = rx.next() => (evt, None)
|
evt = rx.next() => (evt, None)
|
||||||
|
|||||||
Reference in new issue
Block a user