Explorar o código

fix: webconfig should take &mut self

Jonathan Kelley %!s(int64=3) %!d(string=hai) anos
pai
achega
ae676d9d81
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      packages/web/src/cfg.rs

+ 3 - 3
packages/web/src/cfg.rs

@@ -30,7 +30,7 @@ impl WebConfig {
     /// work and suspended nodes.
     ///
     /// Dioxus will load up all the elements with the `dio_el` data attribute into memory when the page is loaded.
-    pub fn hydrate(mut self, f: bool) -> Self {
+    pub fn hydrate(&mut self, f: bool) -> &mut Self {
         self.hydrate = f;
         self
     }
@@ -38,7 +38,7 @@ impl WebConfig {
     /// Set the name of the element that Dioxus will use as the root.
     ///
     /// This is akint to calling React.render() on the element with the specified name.
-    pub fn rootname(mut self, name: impl Into<String>) -> Self {
+    pub fn rootname(&mut self, name: impl Into<String>) -> &mut Self {
         self.rootname = name.into();
         self
     }
@@ -46,7 +46,7 @@ impl WebConfig {
     /// Set the name of the element that Dioxus will use as the root.
     ///
     /// This is akint to calling React.render() on the element with the specified name.
-    pub fn with_string_cache(mut self, cache: Vec<String>) -> Self {
+    pub fn with_string_cache(&mut self, cache: Vec<String>) -> &mut Self {
         self.cached_strings = cache;
         self
     }