-
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Internal iterator ref #41
Conversation
The following lets
diff --git a/Cargo.toml b/Cargo.toml
index 80e7807..c37db04 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -21,7 +21,7 @@ logos = "0.14.0"
chumsky = { git = "https://github.com/zesterer/chumsky", features = [
"label",
"pratt",
-] }
+], rev = "9d1ee8c" }
ariadne = { git = "https://github.com/zesterer/ariadne" }
internal-iterator = "0.2.3"
#rayon = "1.7.0"
diff --git a/src/ast/data/if_else.rs b/src/ast/data/if_else.rs
index e50c9b2..9d74fe3 100644
--- a/src/ast/data/if_else.rs
+++ b/src/ast/data/if_else.rs
@@ -58,7 +58,7 @@ impl IfElse {
pub fn calls_ref(
&self,
- ) -> impl '_ + InternalIterator<Item = &'_ FileSpanned<Call>> {
+ ) -> impl '_ + InternalIteratorRef<ItemRef = &'_ FileSpanned<Call>> {
return CallsRef(self);
// where:
struct CallsRef<'r>(&'r IfElse);
@@ -76,7 +76,7 @@ impl IfElse {
for stmt in self.0.if_body.iter() {
stmt.calls_ref().try_for_each_ref(&mut *f)?;
}
- for stmt in self.0.else_body.iter_mut() {
+ for stmt in self.0.else_body.iter() {
stmt.calls_ref().try_for_each_ref(&mut *f)?;
}
ControlFlow::Continue(())
diff --git a/src/ast/data/loop_.rs b/src/ast/data/loop_.rs
index 4178e36..4e8acee 100644
--- a/src/ast/data/loop_.rs
+++ b/src/ast/data/loop_.rs
@@ -66,7 +66,7 @@ impl Loop {
pub fn calls_ref(
&self,
- ) -> impl '_ + InternalIterator<Item = &'_ FileSpanned<Call>> {
+ ) -> impl '_ + InternalIteratorRef<ItemRef = &'_ FileSpanned<Call>> {
return CallsRef(self);
// where:
struct CallsRef<'r>(&'r Loop);
diff --git a/src/ast/data/statement.rs b/src/ast/data/statement.rs
index 14882ce..44755b1 100644
--- a/src/ast/data/statement.rs
+++ b/src/ast/data/statement.rs
@@ -51,7 +51,7 @@ impl Statement {
pub fn calls_ref(
&self,
- ) -> impl '_ + InternalIteratorRef<Item = &'_ FileSpanned<Call>> {
+ ) -> impl '_ + InternalIteratorRef<ItemRef = &'_ FileSpanned<Call>> {
return CallsRef(self);
// where:
struct CallsRef<'r>(&'r Statement);
That being said, I believe the |
PR submitted: |
* I was being `.lock`ed out of testing the code 🙃 * Fix typo in trait/assoc type usage for `.calls_ref()` * WIP: `git mv src/internal_iterator_re{f,c}.rs` * WIP: finish renaming `InternalIterator{Ref,Mut}` as `InternalIteratorRec` * Rename the call-sites (including `Mut`) accordingly * WIP: Rename `ItemRec` as `Item` to prevent future such mistakes / bad diagnostics * Adjust the call-sites accordingly * WIP: Expose new internal `adhoc_internal_iterator_rec!` helper macro * Profit™ * rustfmt 🥲
No description provided.