Possibly removed the need for ensure_semicolon
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user