From 6aae0cf7fa042d51e97c7606cdf3a338f172f7d2 Mon Sep 17 00:00:00 2001 From: Robin Freyler Date: Sat, 13 Apr 2019 16:43:49 +0200 Subject: replace usages of `algo::generate` with `iter::successors` from std --- crates/ra_assists/src/split_import.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'crates/ra_assists/src') diff --git a/crates/ra_assists/src/split_import.rs b/crates/ra_assists/src/split_import.rs index 4bf1852db..57e0efaf2 100644 --- a/crates/ra_assists/src/split_import.rs +++ b/crates/ra_assists/src/split_import.rs @@ -1,8 +1,9 @@ +use std::iter::successors; + use hir::db::HirDatabase; use ra_syntax::{ TextUnit, AstNode, SyntaxKind::COLONCOLON, ast, - algo::generate, }; use crate::{AssistCtx, Assist, AssistId}; @@ -10,7 +11,7 @@ use crate::{AssistCtx, Assist, AssistId}; pub(crate) fn split_import(mut ctx: AssistCtx) -> Option { let colon_colon = ctx.token_at_offset().find(|leaf| leaf.kind() == COLONCOLON)?; let path = ast::Path::cast(colon_colon.parent())?; - let top_path = generate(Some(path), |it| it.parent_path()).last()?; + let top_path = successors(Some(path), |it| it.parent_path()).last()?; let use_tree = top_path.syntax().ancestors().find_map(ast::UseTree::cast); if use_tree.is_none() { -- cgit v1.2.3