From e6255931f773bf709a54604a5aef01e58364d332 Mon Sep 17 00:00:00 2001 From: Philipp Mildenberger Date: Wed, 16 Aug 2023 17:55:18 +0200 Subject: [PATCH] xilem_html: minor improvement in Element::remove_attr (use `&str` instead of `Into>, - ) -> &mut Self { + pub fn remove_attr(&mut self, name: &str) -> &mut Self { self.0.remove_attr(name); self } diff --git a/crates/xilem_html/src/element/mod.rs b/crates/xilem_html/src/element/mod.rs index 49ac93370..d3dca3d6f 100644 --- a/crates/xilem_html/src/element/mod.rs +++ b/crates/xilem_html/src/element/mod.rs @@ -92,12 +92,12 @@ impl Element { if let Some(value) = value.into_attribute_value() { self.attributes.insert(name, value); } else { - self.attributes.remove(&name); + self.remove_attr(&name); } } - pub fn remove_attr(&mut self, name: impl Into) { - self.attributes.remove(&name.into()); + pub fn remove_attr(&mut self, name: &str) { + self.attributes.remove(name); } /// Set a function to run after the new view tree has been created.