internal: merge hir::BinaryOp and ast::BinOp

This commit is contained in:
Aleksey Kladov 2021-08-14 18:08:31 +03:00
parent fe4f059450
commit 90357a9090
12 changed files with 160 additions and 233 deletions

View file

@ -892,7 +892,7 @@ fn expr_require_exclusive_access(ctx: &AssistContext, expr: &ast::Expr) -> Optio
let parent = expr.syntax().parent()?;
if let Some(bin_expr) = ast::BinExpr::cast(parent.clone()) {
if bin_expr.op_kind()?.is_assignment() {
if matches!(bin_expr.op_kind()?, ast::BinaryOp::Assignment { .. }) {
return Some(bin_expr.lhs()?.syntax() == expr.syntax());
}
return Some(false);