aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/assists/move_bounds.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-10-27 08:27:19 +0000
committerGitHub <[email protected]>2019-10-27 08:27:19 +0000
commitb85f6d522af7630ab227762076a9fbf75de502de (patch)
tree3793da47dbe724189842cabeb5a7cef91ad592ef /crates/ra_assists/src/assists/move_bounds.rs
parent85984b09e182adca4b03d9f7efab20d48b5b632a (diff)
parenta490ba06fa635ecb34b5ce0b7205621eefaee603 (diff)
Merge #2083
2083: document some more assists r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_assists/src/assists/move_bounds.rs')
-rw-r--r--crates/ra_assists/src/assists/move_bounds.rs17
1 files changed, 15 insertions, 2 deletions
diff --git a/crates/ra_assists/src/assists/move_bounds.rs b/crates/ra_assists/src/assists/move_bounds.rs
index d2444b6b9..f96e19a9f 100644
--- a/crates/ra_assists/src/assists/move_bounds.rs
+++ b/crates/ra_assists/src/assists/move_bounds.rs
@@ -1,5 +1,3 @@
1//! FIXME: write short doc here
2
3use hir::db::HirDatabase; 1use hir::db::HirDatabase;
4use ra_syntax::{ 2use ra_syntax::{
5 ast::{self, edit, make, AstNode, NameOwner, TypeBoundsOwner}, 3 ast::{self, edit, make, AstNode, NameOwner, TypeBoundsOwner},
@@ -9,6 +7,21 @@ use ra_syntax::{
9 7
10use crate::{Assist, AssistCtx, AssistId}; 8use crate::{Assist, AssistCtx, AssistId};
11 9
10// Assist: move_bounds_to_where_clause
11//
12// Moves inline type bounds to a where clause.
13//
14// ```
15// fn apply<T, U, <|>F: FnOnce(T) -> U>(f: F, x: T) -> U {
16// f(x)
17// }
18// ```
19// ->
20// ```
21// fn apply<T, U, F>(f: F, x: T) -> U where F: FnOnce(T) -> U {
22// f(x)
23// }
24// ```
12pub(crate) fn move_bounds_to_where_clause(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assist> { 25pub(crate) fn move_bounds_to_where_clause(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assist> {
13 let type_param_list = ctx.node_at_offset::<ast::TypeParamList>()?; 26 let type_param_list = ctx.node_at_offset::<ast::TypeParamList>()?;
14 27