mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Support paths other than "Some".
This commit is contained in:
parent
1841a39f86
commit
91ab3f8760
2 changed files with 59 additions and 10 deletions
|
@ -110,14 +110,15 @@ pub fn match_arm_list(arms: impl Iterator<Item = ast::MatchArm>) -> ast::MatchAr
|
|||
}
|
||||
}
|
||||
|
||||
pub fn let_match_early(expr: ast::Expr, early_expression: &str) -> ast::LetStmt {
|
||||
pub fn let_match_early(expr: ast::Expr, path: &str, early_expression: &str) -> ast::LetStmt {
|
||||
return from_text(&format!(
|
||||
r#"let {} = match {} {{
|
||||
Some(it) => it,
|
||||
{}(it) => it,
|
||||
None => {},
|
||||
}};"#,
|
||||
expr.syntax().text(),
|
||||
expr.syntax().text(),
|
||||
path,
|
||||
early_expression
|
||||
));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue