Skip to content

Commit 390a5cb

Browse files
committed
fmt: cargo
1 parent b6b92f9 commit 390a5cb

File tree

2 files changed

+33
-8
lines changed

2 files changed

+33
-8
lines changed

glass-easel-template-compiler/src/parse/tag.rs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2075,7 +2075,7 @@ impl Element {
20752075
};
20762076
list.push((tag_location.clone(), path.0.clone(), path.1.clone()));
20772077
}
2078-
_ => {},
2078+
_ => {}
20792079
}
20802080

20812081
// write script module
@@ -2117,7 +2117,9 @@ impl Element {
21172117
{
21182118
ps.add_warning(ParseErrorKind::DuplicatedName, name.location());
21192119
} else {
2120-
globals.sub_templates.push((tag_location.clone(), loc, name.clone(), new_children));
2120+
globals
2121+
.sub_templates
2122+
.push((tag_location.clone(), loc, name.clone(), new_children));
21212123
}
21222124
} else {
21232125
let wrap_children = |mut element: Element| -> Vec<Node> {
@@ -3173,13 +3175,20 @@ impl Script {
31733175

31743176
pub fn module_location(&self) -> Range<Position> {
31753177
match self {
3176-
Self::Inline { module_location, .. } | Self::GlobalRef { module_location, .. } => module_location.clone(),
3178+
Self::Inline {
3179+
module_location, ..
3180+
}
3181+
| Self::GlobalRef {
3182+
module_location, ..
3183+
} => module_location.clone(),
31773184
}
31783185
}
31793186

31803187
pub fn tag_location(&self) -> TagLocation {
31813188
match self {
3182-
Self::Inline { tag_location, .. } | Self::GlobalRef { tag_location, .. } => tag_location.clone(),
3189+
Self::Inline { tag_location, .. } | Self::GlobalRef { tag_location, .. } => {
3190+
tag_location.clone()
3191+
}
31833192
}
31843193
}
31853194
}

glass-easel-template-compiler/src/stringify/tag.rs

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,18 @@ impl Stringify for Template {
5454
None,
5555
content_location,
5656
)?;
57-
stringifier.write_token(r#"<"#, None, &tag_location.end.as_ref().unwrap_or(&tag_location.start).0)?;
57+
stringifier.write_token(
58+
r#"<"#,
59+
None,
60+
&tag_location.end.as_ref().unwrap_or(&tag_location.start).0,
61+
)?;
5862
stringifier.write_token("/", None, &tag_location.close)?;
5963
stringifier.write_str(r#"wxs"#)?;
60-
stringifier.write_token(r#">"#, None, &tag_location.end.as_ref().unwrap_or(&tag_location.start).1)?;
64+
stringifier.write_token(
65+
r#">"#,
66+
None,
67+
&tag_location.end.as_ref().unwrap_or(&tag_location.start).1,
68+
)?;
6169
} else {
6270
stringifier.write_token("/", None, &tag_location.close)?;
6371
stringifier.write_token(">", None, &tag_location.start.1)?;
@@ -92,10 +100,18 @@ impl Stringify for Template {
92100
for node in nodes {
93101
node.stringify_write(stringifier)?;
94102
}
95-
stringifier.write_token(r#"<"#, None, &tag_location.end.as_ref().unwrap_or(&tag_location.start).0)?;
103+
stringifier.write_token(
104+
r#"<"#,
105+
None,
106+
&tag_location.end.as_ref().unwrap_or(&tag_location.start).0,
107+
)?;
96108
stringifier.write_token("/", None, &tag_location.close)?;
97109
stringifier.write_str(r#"template"#)?;
98-
stringifier.write_token(r#">"#, None, &tag_location.end.as_ref().unwrap_or(&tag_location.start).1)?;
110+
stringifier.write_token(
111+
r#">"#,
112+
None,
113+
&tag_location.end.as_ref().unwrap_or(&tag_location.start).1,
114+
)?;
99115
} else {
100116
stringifier.write_token("/", None, &tag_location.close)?;
101117
stringifier.write_token(">", None, &tag_location.start.1)?;

0 commit comments

Comments
 (0)