Skip to content

Commit

Permalink
Format Rust code using rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Nov 17, 2023
1 parent 2f7870c commit 5fd6a0f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
6 changes: 3 additions & 3 deletions crates/core/src/web/widgets/csr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ where
#[track_caller]
pub fn toggle_class<V, C>(self, value: V, cond: C) -> Self
where
V: Into<String>,
V: Into<String>,
C: Into<Lotus<bool>>,
{
self.switch_class(value, "", cond)
Expand All @@ -233,8 +233,8 @@ where
#[track_caller]
pub fn switch_class<TV, FV, C>(mut self, tv: TV, fv: FV, cond: C) -> Self
where
TV: Into<String>,
FV: Into<String>,
TV: Into<String>,
FV: Into<String>,
C: Into<Lotus<bool>>,
{
let tv = tv.into();
Expand Down
11 changes: 3 additions & 8 deletions crates/core/src/web/widgets/node_meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ impl Widget for NodeMeta {
for (name, value) in &self.attrs {
value.inject_to(&ctx.view_id, &mut self.node, name, true);
}
self.classes
.inject_to(&ctx.view_id, &mut self.node, "class", true);
self.classes.inject_to(&ctx.view_id, &mut self.node, "class", true);

#[cfg(not(all(target_arch = "wasm32", feature = "web-csr")))]
ctx.truck_mut().insert(self.truck_key, self.node.clone());
Expand All @@ -53,10 +52,7 @@ impl Widget for NodeMeta {
for name in self.attrs.keys() {
self.node.remove_attribute(name).unwrap_throw();
}
self.node
.class_list()
.remove(&self.classes.to_array())
.unwrap_throw();
self.node.class_list().remove(&self.classes.to_array()).unwrap_throw();
}

#[cfg(all(target_arch = "wasm32", feature = "web-csr"))]
Expand All @@ -67,8 +63,7 @@ impl Widget for NodeMeta {
for (name, value) in &self.attrs {
value.inject_to(&ctx.view_id, &mut self.node, name, false);
}
self.classes
.inject_to(&ctx.view_id, &mut self.node, "class", false);
self.classes.inject_to(&ctx.view_id, &mut self.node, "class", false);
}
}

Expand Down
9 changes: 3 additions & 6 deletions crates/core/src/web/widgets/ssr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,11 @@ impl Widget for Element {
value.inject_to(&ctx.view_id, &mut self.node, name, true);
}

self.attrs
.insert("gly-id".into(), Box::new(ctx.view_id.clone()));
self.attrs.insert("gly-id".into(), Box::new(ctx.view_id.clone()));
for (name, value) in &self.attrs {
value.inject_to(&ctx.view_id, &mut self.node, name, true);
}
self.classes
.inject_to(&ctx.view_id, &mut self.node, "class", true);
self.classes.inject_to(&ctx.view_id, &mut self.node, "class", true);
}

fn flood(&mut self, ctx: &mut Scope) {
Expand Down Expand Up @@ -86,8 +84,7 @@ impl Widget for Element {
for (name, value) in &self.attrs {
value.inject_to(&ctx.view_id, &mut self.node, name, false);
}
self.classes
.inject_to(&ctx.view_id, &mut self.node, "class", false);
self.classes.inject_to(&ctx.view_id, &mut self.node, "class", false);
}
}

Expand Down

0 comments on commit 5fd6a0f

Please sign in to comment.