diff options
Diffstat (limited to 'crates/ra_fmt')
-rw-r--r-- | crates/ra_fmt/src/lib.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_fmt/src/lib.rs b/crates/ra_fmt/src/lib.rs index 85b7ce250..603be1854 100644 --- a/crates/ra_fmt/src/lib.rs +++ b/crates/ra_fmt/src/lib.rs | |||
@@ -1,10 +1,10 @@ | |||
1 | //! This crate provides some utilities for indenting rust code. | 1 | //! This crate provides some utilities for indenting rust code. |
2 | //! | 2 | //! |
3 | use std::iter::successors; | ||
3 | use itertools::Itertools; | 4 | use itertools::Itertools; |
4 | use ra_syntax::{ | 5 | use ra_syntax::{ |
5 | SyntaxNode, SyntaxKind::*, SyntaxToken, SyntaxKind, | 6 | SyntaxNode, SyntaxKind::*, SyntaxToken, SyntaxKind, |
6 | ast::{self, AstNode, AstToken}, | 7 | ast::{self, AstNode, AstToken}, |
7 | algo::generate, | ||
8 | }; | 8 | }; |
9 | 9 | ||
10 | pub fn reindent(text: &str, indent: &str) -> String { | 10 | pub fn reindent(text: &str, indent: &str) -> String { |
@@ -29,7 +29,7 @@ pub fn leading_indent(node: &SyntaxNode) -> Option<&str> { | |||
29 | } | 29 | } |
30 | 30 | ||
31 | fn prev_tokens(token: SyntaxToken) -> impl Iterator<Item = SyntaxToken> { | 31 | fn prev_tokens(token: SyntaxToken) -> impl Iterator<Item = SyntaxToken> { |
32 | generate(token.prev_token(), |&token| token.prev_token()) | 32 | successors(token.prev_token(), |&token| token.prev_token()) |
33 | } | 33 | } |
34 | 34 | ||
35 | pub fn extract_trivial_expression(block: &ast::Block) -> Option<&ast::Expr> { | 35 | pub fn extract_trivial_expression(block: &ast::Block) -> Option<&ast::Expr> { |