aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax
diff options
context:
space:
mode:
authorkrk <[email protected]>2019-11-01 17:18:58 +0000
committerkrk <[email protected]>2019-11-01 17:18:58 +0000
commit91ab3f876020872f1f692577792569b7b6c8239d (patch)
treef8ad0fe2ffc59dce786767cc447eebece9b46282 /crates/ra_syntax
parent1841a39f865b38041e84cd80840587dbe57d62c1 (diff)
Support paths other than "Some".
Diffstat (limited to 'crates/ra_syntax')
-rw-r--r--crates/ra_syntax/src/ast/make.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/ra_syntax/src/ast/make.rs b/crates/ra_syntax/src/ast/make.rs
index 979819d4b..95062ef6c 100644
--- a/crates/ra_syntax/src/ast/make.rs
+++ b/crates/ra_syntax/src/ast/make.rs
@@ -110,14 +110,15 @@ pub fn match_arm_list(arms: impl Iterator<Item = ast::MatchArm>) -> ast::MatchAr
110 } 110 }
111} 111}
112 112
113pub fn let_match_early(expr: ast::Expr, early_expression: &str) -> ast::LetStmt { 113pub fn let_match_early(expr: ast::Expr, path: &str, early_expression: &str) -> ast::LetStmt {
114 return from_text(&format!( 114 return from_text(&format!(
115 r#"let {} = match {} {{ 115 r#"let {} = match {} {{
116 Some(it) => it, 116 {}(it) => it,
117 None => {}, 117 None => {},
118}};"#, 118}};"#,
119 expr.syntax().text(), 119 expr.syntax().text(),
120 expr.syntax().text(), 120 expr.syntax().text(),
121 path,
121 early_expression 122 early_expression
122 )); 123 ));
123 124