aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-04-13 16:25:17 +0100
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-04-13 16:25:17 +0100
commit23b876bc3b00c53ce24b8a99b4f4bf190fc6300e (patch)
tree632767346f695b6a2d547997c452070dc1f39dca /crates/ra_hir
parent8887782c4ab97d22f3d5c10e142407e4371c5c61 (diff)
parent6aae0cf7fa042d51e97c7606cdf3a338f172f7d2 (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_hir')
-rw-r--r--crates/ra_hir/src/ty/autoderef.rs4
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
6use ra_syntax::algo::generate; 6use std::iter::successors;
7 7
8use crate::HirDatabase; 8use crate::HirDatabase;
9use super::Ty; 9use super::Ty;
@@ -11,7 +11,7 @@ use super::Ty;
11impl Ty { 11impl 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> {