diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-04-13 16:25:17 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-04-13 16:25:17 +0100 |
commit | 23b876bc3b00c53ce24b8a99b4f4bf190fc6300e (patch) | |
tree | 632767346f695b6a2d547997c452070dc1f39dca /crates/ra_fmt | |
parent | 8887782c4ab97d22f3d5c10e142407e4371c5c61 (diff) | |
parent | 6aae0cf7fa042d51e97c7606cdf3a338f172f7d2 (diff) |
Merge #1143
1143: replace usages of `algo::generate` with `iter::successors` from std r=matklad a=Robbepop
Implements #1136
Co-authored-by: Robin Freyler <[email protected]>
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> { |