aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/handlers/change_return_type_to_result.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-07-30 20:03:25 +0100
committerGitHub <[email protected]>2020-07-30 20:03:25 +0100
commit239dd506f68db0cbe4417b6e5c7f737d8ff8a159 (patch)
treedd3503a2be3a6699a6b111844dbcdc85b37e2425 /crates/ra_assists/src/handlers/change_return_type_to_result.rs
parent134d3c3c5068abc5ed3e03fe5df2b524ea70753d (diff)
parentf95f425ae4199e814e6956be1d9bb59a14758c07 (diff)
Merge #5613
5613: Use ty to access most TypeRefs r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_assists/src/handlers/change_return_type_to_result.rs')
-rw-r--r--crates/ra_assists/src/handlers/change_return_type_to_result.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ra_assists/src/handlers/change_return_type_to_result.rs b/crates/ra_assists/src/handlers/change_return_type_to_result.rs
index 12018fc6a..167e162d8 100644
--- a/crates/ra_assists/src/handlers/change_return_type_to_result.rs
+++ b/crates/ra_assists/src/handlers/change_return_type_to_result.rs
@@ -22,7 +22,7 @@ pub(crate) fn change_return_type_to_result(acc: &mut Assists, ctx: &AssistContex
22 // FIXME: extend to lambdas as well 22 // FIXME: extend to lambdas as well
23 let fn_def = ret_type.syntax().parent().and_then(ast::Fn::cast)?; 23 let fn_def = ret_type.syntax().parent().and_then(ast::Fn::cast)?;
24 24
25 let type_ref = &ret_type.type_ref()?; 25 let type_ref = &ret_type.ty()?;
26 let ret_type_str = type_ref.syntax().text().to_string(); 26 let ret_type_str = type_ref.syntax().text().to_string();
27 let first_part_ret_type = ret_type_str.splitn(2, '<').next(); 27 let first_part_ret_type = ret_type_str.splitn(2, '<').next();
28 if let Some(ret_type_first_part) = first_part_ret_type { 28 if let Some(ret_type_first_part) = first_part_ret_type {