mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-15 16:11:01 +00:00
Replace if let Some(_) = foo
with if foo.is_some()
This commit is contained in:
parent
eff195852d
commit
f29796da61
6 changed files with 7 additions and 7 deletions
|
@ -455,7 +455,7 @@ impl ast::RecordExprField {
|
|||
/// This will either replace the initializer, or in the case that this is a shorthand convert
|
||||
/// the initializer into the name ref and insert the expr as the new initializer.
|
||||
pub fn replace_expr(&self, expr: ast::Expr) {
|
||||
if let Some(_) = self.name_ref() {
|
||||
if self.name_ref().is_some() {
|
||||
match self.expr() {
|
||||
Some(prev) => ted::replace(prev.syntax(), expr.syntax()),
|
||||
None => ted::append_child(self.syntax(), expr.syntax()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue