diff options
author | Robin Freyler <[email protected]> | 2019-04-13 15:43:49 +0100 |
---|---|---|
committer | Robin Freyler <[email protected]> | 2019-04-13 15:43:49 +0100 |
commit | 6aae0cf7fa042d51e97c7606cdf3a338f172f7d2 (patch) | |
tree | 632767346f695b6a2d547997c452070dc1f39dca /crates/ra_hir/src | |
parent | 8887782c4ab97d22f3d5c10e142407e4371c5c61 (diff) |
replace usages of `algo::generate` with `iter::successors` from std
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r-- | crates/ra_hir/src/ty/autoderef.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_hir/src/ty/autoderef.rs b/crates/ra_hir/src/ty/autoderef.rs index ab5f008ef..a442a856c 100644 --- a/crates/ra_hir/src/ty/autoderef.rs +++ b/crates/ra_hir/src/ty/autoderef.rs | |||
@@ -3,7 +3,7 @@ | |||
3 | //! reference to a type with the field `bar`. This is an approximation of the | 3 | //! reference to a type with the field `bar`. This is an approximation of the |
4 | //! logic in rustc (which lives in librustc_typeck/check/autoderef.rs). | 4 | //! logic in rustc (which lives in librustc_typeck/check/autoderef.rs). |
5 | 5 | ||
6 | use ra_syntax::algo::generate; | 6 | use std::iter::successors; |
7 | 7 | ||
8 | use crate::HirDatabase; | 8 | use crate::HirDatabase; |
9 | use super::Ty; | 9 | use super::Ty; |
@@ -11,7 +11,7 @@ use super::Ty; | |||
11 | impl Ty { | 11 | impl Ty { |
12 | /// Iterates over the possible derefs of `ty`. | 12 | /// Iterates over the possible derefs of `ty`. |
13 | pub fn autoderef<'a>(self, db: &'a impl HirDatabase) -> impl Iterator<Item = Ty> + 'a { | 13 | pub fn autoderef<'a>(self, db: &'a impl HirDatabase) -> impl Iterator<Item = Ty> + 'a { |
14 | generate(Some(self), move |ty| ty.autoderef_step(db)) | 14 | successors(Some(self), move |ty| ty.autoderef_step(db)) |
15 | } | 15 | } |
16 | 16 | ||
17 | fn autoderef_step(&self, _db: &impl HirDatabase) -> Option<Ty> { | 17 | fn autoderef_step(&self, _db: &impl HirDatabase) -> Option<Ty> { |