1
0
Evan Almloff 1 жил өмнө
parent
commit
7f0fa07757

+ 0 - 2
packages/core-macro/tests/rsx.rs

@@ -1,5 +1,3 @@
-use dioxus::prelude::*;
-
 #[test]
 fn rsx() {
     let t = trybuild::TestCases::new();

+ 1 - 0
packages/fullstack/src/hooks/server_cached.rs

@@ -15,6 +15,7 @@ use serde::{de::DeserializeOwned, Serialize};
 ///    let state1 = use_state(cx, || from_server(|| {
 ///       1234
 ///    }));
+///    todo!()
 /// }
 /// ```
 pub fn server_cached<O: 'static + Serialize + DeserializeOwned>(server_fn: impl Fn() -> O) -> O {

+ 15 - 1
packages/rsx/src/attribute.rs

@@ -37,12 +37,26 @@ impl ToTokens for AttributeType {
     }
 }
 
-#[derive(PartialEq, Eq, Clone, Debug, Hash)]
+#[derive(Clone, Debug)]
 pub struct ElementAttrNamed {
     pub el_name: ElementName,
     pub attr: ElementAttr,
 }
 
+impl Hash for ElementAttrNamed {
+    fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
+        self.attr.name.hash(state);
+    }
+}
+
+impl PartialEq for ElementAttrNamed {
+    fn eq(&self, other: &Self) -> bool {
+        self.attr == other.attr
+    }
+}
+
+impl Eq for ElementAttrNamed {}
+
 impl ElementAttrNamed {
     pub(crate) fn try_combine(&self, other: &Self) -> Option<Self> {
         if self.el_name == other.el_name && self.attr.name == other.attr.name {