Skip to content
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

feat: add component values iterator #238

Merged
merged 1 commit into from
Nov 9, 2023
Merged

Conversation

neuodev
Copy link
Collaborator

@neuodev neuodev commented Nov 7, 2023

No description provided.

@neuodev neuodev self-assigned this Nov 7, 2023
@neuodev neuodev marked this pull request as ready for review November 8, 2023 18:44
@neuodev neuodev requested a review from a team November 8, 2023 18:44
Copy link
Collaborator

@emwalker emwalker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with suggestion to not use "iterator" in the name unless this will become an actual iterator.

struct ValueIterator {
pub values: Vec<ComponentValue>,
pub position: usize,
}
Copy link
Collaborator

@emwalker emwalker Nov 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used the name "CharIterator," but that was just a placeholder. It was intended to be transitional until the time when I would be able to do

impl Iterator for CharIterator {
  type Item = bytes::Bytes;

  fn next(&mut self) -> Option<Self::Item> {
    // ...
  }
}

(This is what would make it a real iterator.)

I now have doubts that CharIterator will actually be a real iterator (implementing Iterator), and I'm guessing the name will change to something like BufferQueue. So I'd recommend not copying the the "Iterator" name unless it's an actual iterator. What you have here is more of a ValueBuffer or something. (There's probably a better name than ValueBuffer that will come to mind.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, you are correct! I will rename it to ValueBuffer and about the CharIterator, I think we can also call it CharBuffer

@neuodev neuodev merged commit 2b3d128 into main Nov 9, 2023
4 checks passed
@neuodev neuodev deleted the ahmed/component-values-iter branch November 9, 2023 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants