diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-07-30 13:18:41 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-07-30 13:18:41 +0100 |
commit | 51b18ee2f1c3c9f7ea58c5f00b451e683048f618 (patch) | |
tree | 1152a079401b2d34bcc903f7935fe1aff0b7b3db /crates/ra_assists/src/utils | |
parent | 9042009b7f1ba0f85e892ac5184fa4542d0c10f5 (diff) | |
parent | 02cac962e133d420485bc7b64698902dcc26a5e7 (diff) |
Merge #5587
5587: Finish use grammar r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_assists/src/utils')
-rw-r--r-- | crates/ra_assists/src/utils/insert_use.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_assists/src/utils/insert_use.rs b/crates/ra_assists/src/utils/insert_use.rs index c05027eff..617afe2e9 100644 --- a/crates/ra_assists/src/utils/insert_use.rs +++ b/crates/ra_assists/src/utils/insert_use.rs | |||
@@ -225,7 +225,7 @@ fn walk_use_tree_for_best_action( | |||
225 | current_use_tree | 225 | current_use_tree |
226 | .syntax() | 226 | .syntax() |
227 | .ancestors() | 227 | .ancestors() |
228 | .find_map(ast::UseItem::cast) | 228 | .find_map(ast::Use::cast) |
229 | .map(|it| it.syntax().clone()), | 229 | .map(|it| it.syntax().clone()), |
230 | true, | 230 | true, |
231 | ); | 231 | ); |
@@ -254,7 +254,7 @@ fn walk_use_tree_for_best_action( | |||
254 | current_use_tree | 254 | current_use_tree |
255 | .syntax() | 255 | .syntax() |
256 | .ancestors() | 256 | .ancestors() |
257 | .find_map(ast::UseItem::cast) | 257 | .find_map(ast::Use::cast) |
258 | .map(|it| it.syntax().clone()), | 258 | .map(|it| it.syntax().clone()), |
259 | true, | 259 | true, |
260 | ), | 260 | ), |
@@ -304,7 +304,7 @@ fn walk_use_tree_for_best_action( | |||
304 | current_use_tree | 304 | current_use_tree |
305 | .syntax() | 305 | .syntax() |
306 | .ancestors() | 306 | .ancestors() |
307 | .find_map(ast::UseItem::cast) | 307 | .find_map(ast::Use::cast) |
308 | .map(|it| it.syntax().clone()), | 308 | .map(|it| it.syntax().clone()), |
309 | true, | 309 | true, |
310 | ); | 310 | ); |
@@ -377,7 +377,7 @@ fn best_action_for_target( | |||
377 | let mut storage = Vec::with_capacity(16); // this should be the only allocation | 377 | let mut storage = Vec::with_capacity(16); // this should be the only allocation |
378 | let best_action = container | 378 | let best_action = container |
379 | .children() | 379 | .children() |
380 | .filter_map(ast::UseItem::cast) | 380 | .filter_map(ast::Use::cast) |
381 | .filter_map(|it| it.use_tree()) | 381 | .filter_map(|it| it.use_tree()) |
382 | .map(|u| walk_use_tree_for_best_action(&mut storage, None, u, target)) | 382 | .map(|u| walk_use_tree_for_best_action(&mut storage, None, u, target)) |
383 | .fold(None, |best, a| match best { | 383 | .fold(None, |best, a| match best { |