chore: update with master
This commit is contained in:
1 parent
4313dea351
commit
182f11d0f3
1 file changed
+11
-7
@@ -298,7 +298,7 @@ impl Buffer {
|
|||||||
}
|
}
|
||||||
[BodyNode::RawExpr(ref expr)] => {
|
[BodyNode::RawExpr(ref expr)] => {
|
||||||
// TODO: let rawexprs to be inlined
|
// TODO: let rawexprs to be inlined
|
||||||
get_expr_length(&expr.expr)
|
get_expr_length(expr)
|
||||||
}
|
}
|
||||||
[BodyNode::Element(ref el)] => {
|
[BodyNode::Element(ref el)] => {
|
||||||
let attr_len = self.is_short_attrs(&el.attributes);
|
let attr_len = self.is_short_attrs(&el.attributes);
|
||||||
@@ -309,10 +309,10 @@ impl Buffer {
|
|||||||
|
|
||||||
if el.children.len() == 1 {
|
if el.children.len() == 1 {
|
||||||
if let BodyNode::Text(ref text) = el.children[0] {
|
if let BodyNode::Text(ref text) = el.children[0] {
|
||||||
if text.text.value().len() + el.name.to_string().len() + attr_len < 80 {
|
let value = text.source.as_ref().unwrap().value();
|
||||||
return Some(
|
|
||||||
text.text.value().len() + el.name.to_string().len() + attr_len,
|
if value.len() + el.name.to_string().len() + attr_len < 80 {
|
||||||
);
|
return Some(value.len() + el.name.to_string().len() + attr_len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -326,11 +326,15 @@ impl Buffer {
|
|||||||
for item in items {
|
for item in items {
|
||||||
match item {
|
match item {
|
||||||
BodyNode::Component(_) | BodyNode::Element(_) => return None,
|
BodyNode::Component(_) | BodyNode::Element(_) => return None,
|
||||||
BodyNode::Text(text) => total_count += text.text.value().len(),
|
BodyNode::Text(text) => {
|
||||||
BodyNode::RawExpr(expr) => match get_expr_length(&expr.expr) {
|
total_count += text.source.as_ref().unwrap().value().len()
|
||||||
|
}
|
||||||
|
BodyNode::RawExpr(expr) => match get_expr_length(expr) {
|
||||||
Some(len) => total_count += len,
|
Some(len) => total_count += len,
|
||||||
None => return None,
|
None => return None,
|
||||||
},
|
},
|
||||||
|
BodyNode::ForLoop(_) => todo!(),
|
||||||
|
BodyNode::IfChain(_) => todo!(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user