use BumpBox<Any> and FromAnyValue instead of sync bounds

This commit is contained in:
Evan Almloff committed 2023-01-02 14:40:25 -06:00
1 parent 64db1def9f
commit 51dba50c04
20 files changed
+184 -200

No files matched your search

+10 -5
View File
@@ -7,7 +7,9 @@
//! - tests to ensure dyn_into works for various event types.
//! - Partial delegation?>
use dioxus_core::{ElementId, Mutation, Template, TemplateAttribute, TemplateNode};
use dioxus_core::{
BorrowedAttributeValue, ElementId, Mutation, Template, TemplateAttribute, TemplateNode,
};
use dioxus_html::{event_bubbles, CompositionData, FormData};
use dioxus_interpreter_js::{save_template, Channel};
use futures_channel::mpsc;
@@ -176,21 +178,24 @@ impl WebsysDom {
id,
ns,
} => match value {
dioxus_core::AttributeValue::Text(txt) => {
BorrowedAttributeValue::Text(txt) => {
i.set_attribute(id.0 as u32, name, txt, ns.unwrap_or_default())
}
dioxus_core::AttributeValue::Float(f) => {
BorrowedAttributeValue::Float(f) => {
i.set_attribute(id.0 as u32, name, &f.to_string(), ns.unwrap_or_default())
}
dioxus_core::AttributeValue::Int(n) => {
BorrowedAttributeValue::Int(n) => {
i.set_attribute(id.0 as u32, name, &n.to_string(), ns.unwrap_or_default())
}
dioxus_core::AttributeValue::Bool(b) => i.set_attribute(
BorrowedAttributeValue::Bool(b) => i.set_attribute(
id.0 as u32,
name,
if *b { "true" } else { "false" },
ns.unwrap_or_default(),
),
BorrowedAttributeValue::None => {
i.remove_attribute(id.0 as u32, name, ns.unwrap_or_default())
}
_ => unreachable!(),
},
SetText { value, id } => i.set_text(id.0 as u32, value),