Skip to content

Commit

Permalink
fmt: cargo
Browse files Browse the repository at this point in the history
  • Loading branch information
LastLeaf committed Jul 24, 2024
1 parent 1f7932b commit 8be879d
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions glass-easel-template-compiler/src/proc_gen/tag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,10 @@ impl Node {
}

impl Element {
fn collect_active_attribute_names<E>(&self, mut f: impl FnMut(&str) -> Result<(), E>) -> Result<(), E> {
fn collect_active_attribute_names<E>(
&self,
mut f: impl FnMut(&str) -> Result<(), E>,
) -> Result<(), E> {
match &self.kind {
ElementKind::Normal {
attributes,
Expand Down Expand Up @@ -459,12 +462,20 @@ impl Element {
f(&gen_lit_str(&format!("mark:{}", &attr.name.name)))?;
}
}
ElementKind::Pure { slot, slot_value_refs: _, .. } => {
ElementKind::Pure {
slot,
slot_value_refs: _,
..
} => {
if !slot.is_some() {
f("\":slot\"")?;
}
}
ElementKind::Slot { name, values, common } => {
ElementKind::Slot {
name,
values,
common,
} => {
if common.id.is_some() {
f("\":id\"")?;
}
Expand Down Expand Up @@ -551,9 +562,7 @@ impl Element {
if group.dev() {
w.expr_stmt(|w| {
write!(w, "R.devArgs(N).A=[")?;
self.collect_active_attribute_names(|str| {
write!(w, "{},", str)
})?;
self.collect_active_attribute_names(|str| write!(w, "{},", str))?;
write!(w, "]")?;
Ok(())
})?;
Expand Down

0 comments on commit 8be879d

Please sign in to comment.