Possibly removed the need for ensure_semicolon

This commit is contained in:
2026-07-02 06:33:17 +02:00
parent 68cf239f92
commit 4579c656b9
6 changed files with 20 additions and 54 deletions
+9 -11
View File
@@ -96,16 +96,6 @@ pub enum Generic {
Type(TypeExpr),
}
impl Expression {
pub fn is_block(&self) -> bool {
if let Expression::Statement(stmt) = self {
stmt.is_block()
} else {
false
}
}
}
impl From<Path> for ExprPath {
fn from(path: Path) -> Self {
Self(
@@ -125,9 +115,17 @@ impl Expression {
match self {
Self::Statement(v) => match &**v {
Statement::TopLevel(_) => false,
_ => true,
stmt => !stmt.is_block(),
},
_ => true,
}
}
pub fn is_block(&self) -> bool {
if let Expression::Statement(stmt) = self {
stmt.is_block()
} else {
false
}
}
}