mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-12 13:18:47 +00:00
Fix assist description
This commit is contained in:
parent
a4901fdcfd
commit
dc311b10f3
2 changed files with 9 additions and 5 deletions
|
@ -1,6 +1,12 @@
|
||||||
|
use std::iter::once;
|
||||||
|
|
||||||
use hir::Adt;
|
use hir::Adt;
|
||||||
use ra_syntax::{
|
use ra_syntax::{
|
||||||
ast::{self, make},
|
ast::{
|
||||||
|
self,
|
||||||
|
edit::{AstNodeEdit, IndentLevel},
|
||||||
|
make,
|
||||||
|
},
|
||||||
AstNode, T,
|
AstNode, T,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -8,12 +14,10 @@ use crate::{
|
||||||
assist_ctx::{Assist, AssistCtx},
|
assist_ctx::{Assist, AssistCtx},
|
||||||
AssistId,
|
AssistId,
|
||||||
};
|
};
|
||||||
use ast::edit::{AstNodeEdit, IndentLevel};
|
|
||||||
use std::iter::once;
|
|
||||||
|
|
||||||
// Assist: replace_let_with_if_let
|
// 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 }
|
// # enum Option<T> { Some(T), None }
|
||||||
|
|
|
@ -585,7 +585,7 @@ fn handle(action: Action) {
|
||||||
|
|
||||||
## `replace_let_with_if_let`
|
## `replace_let_with_if_let`
|
||||||
|
|
||||||
Replaces `if let` with an else branch with a `match` expression.
|
Replaces `let` with an `if-let`.
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
// BEFORE
|
// BEFORE
|
||||||
|
|
Loading…
Reference in a new issue