]> git.lizzy.rs Git - rust.git/commitdiff
assists: change_return_type_to_result: clarify assist description
authorMatthias Krüger <matthias.krueger@famsik.de>
Wed, 22 Jul 2020 20:44:31 +0000 (22:44 +0200)
committerMatthias Krüger <matthias.krueger@famsik.de>
Wed, 22 Jul 2020 20:44:31 +0000 (22:44 +0200)
I had a -> Option<PathBuf> fn, which I wanted to change to Result<PathBuf, _>, but despite advertising to do so, the assist did not
change the result type to Result<PathBuf, _> but instead just wrapped it in a Result: <Result<Option<PathBuf>, _>.

I changed the assist description to "Wrap return type in Result" to clarify that the assist only wraps the preexisting type and does
not do any deep Option-to-Result refactoring.

crates/ra_assists/src/handlers/change_return_type_to_result.rs

index 24e5f6963220f00472c2b7758d787c8f7f076232..def00f7d8df25292f139b531ada406af7427be3e 100644 (file)
@@ -36,7 +36,7 @@ pub(crate) fn change_return_type_to_result(acc: &mut Assists, ctx: &AssistContex
 
     acc.add(
         AssistId("change_return_type_to_result", AssistKind::RefactorRewrite),
-        "Change return type to Result",
+        "Wrap return type in Result",
         type_ref.syntax().text_range(),
         |builder| {
             let mut tail_return_expr_collector = TailReturnCollector::new();