Skip to content

Commit 33fee76

Browse files
committed
Change method name to better reflect precisely what it does.
1 parent 90cb074 commit 33fee76

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/dom_types.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ impl Text {
720720
pub fn get_text(&self) -> String {
721721
self.text.to_string()
722722
}
723-
pub fn strip_ws_nodes(&mut self) {
723+
pub fn strip_ws_node(&mut self) {
724724
self.node_ws.take();
725725
}
726726
}
@@ -827,10 +827,10 @@ impl<Ms> Node<Ms> {
827827
}
828828
// Workspace manipulations.
829829
impl<Ms> Node<Ms> {
830-
pub(crate) fn strip_ws_nodes(&mut self) -> &mut Self {
830+
pub(crate) fn strip_own_and_children_ws_nodes(&mut self) -> &mut Self {
831831
match self {
832-
Node::Element(e) => e.strip_ws_nodes(),
833-
Node::Text(t) => t.strip_ws_nodes(),
832+
Node::Element(e) => e.strip_own_and_children_ws_nodes(),
833+
Node::Text(t) => t.strip_ws_node(),
834834
_ => (),
835835
}
836836
self
@@ -930,10 +930,11 @@ pub struct El<Ms: 'static> {
930930
pub hooks: LifecycleHooks<Ms>,
931931
}
932932
impl<Ms> El<Ms> {
933-
pub(crate) fn strip_ws_nodes(&mut self) {
933+
/// Strips ws nodes in the children as well.
934+
pub(crate) fn strip_own_and_children_ws_nodes(&mut self) {
934935
self.node_ws.take();
935936
for child in &mut self.children {
936-
child.strip_ws_nodes();
937+
child.strip_own_and_children_ws_nodes();
937938
}
938939
}
939940
}

src/vdom.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ impl<Ms, Mdl, ElC: View<Ms> + 'static, GMs: 'static> App<Ms, Mdl, ElC, GMs> {
215215
// TODO: and other, similar things. For now, leave the warning in the builder's
216216
// TODO: documentation.
217217
let mut dom_nodes = websys_bridge::el_from_ws_element(&self.cfg.mount_point);
218-
dom_nodes.strip_ws_nodes();
218+
dom_nodes.strip_own_and_children_ws_nodes();
219219

220220
// Replace the root dom with a placeholder tag and move the children from the root element
221221
// to the newly created root. Uses `Placeholder` to mimic update logic.

0 commit comments

Comments
 (0)