mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 04:53:34 +00:00
Merge #3743
3743: Fix assist description r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
75f6ab208a
2 changed files with 9 additions and 5 deletions
|
@ -1,6 +1,12 @@
|
|||
use std::iter::once;
|
||||
|
||||
use hir::Adt;
|
||||
use ra_syntax::{
|
||||
ast::{self, make},
|
||||
ast::{
|
||||
self,
|
||||
edit::{AstNodeEdit, IndentLevel},
|
||||
make,
|
||||
},
|
||||
AstNode, T,
|
||||
};
|
||||
|
||||
|
@ -8,12 +14,10 @@ use crate::{
|
|||
assist_ctx::{Assist, AssistCtx},
|
||||
AssistId,
|
||||
};
|
||||
use ast::edit::{AstNodeEdit, IndentLevel};
|
||||
use std::iter::once;
|
||||
|
||||
// Assist: replace_let_with_if_let
|
||||
//
|
||||
// Replaces `if let` with an else branch with a `match` expression.
|
||||
// Replaces `let` with an `if-let`.
|
||||
//
|
||||
// ```
|
||||
// # enum Option<T> { Some(T), None }
|
||||
|
|
|
@ -585,7 +585,7 @@ fn handle(action: Action) {
|
|||
|
||||
## `replace_let_with_if_let`
|
||||
|
||||
Replaces `if let` with an else branch with a `match` expression.
|
||||
Replaces `let` with an `if-let`.
|
||||
|
||||
```rust
|
||||
// BEFORE
|
||||
|
|
Loading…
Reference in a new issue