Skip to content

register iterator #512

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

Merged
merged 1 commit into from
May 1, 2021
Merged

register iterator #512

merged 1 commit into from
May 1, 2021

Conversation

burrbull
Copy link
Member

No description provided.

@burrbull burrbull requested a review from a team as a code owner April 30, 2021 18:52
@rust-highfive
Copy link

r? @therealprof

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-tools labels Apr 30, 2021
@@ -1101,10 +1101,10 @@ fn lookup_in_peripheral<'p>(
base_register: &'p str,
base_field: &str,
base_evs: &str,
all_registers: &[&'p Register],
mut all_registers: impl Iterator<Item = &'p Register>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, why is this mut now?

Copy link
Member Author

@burrbull burrbull May 1, 2021

Choose a reason for hiding this comment

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

Because iteration is mutable one-off operation.
If it is hard to read, I can bring vector and slice back.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, don't we have a concrete borrowable type for all Registers to pass in? I would expect that can build something like a RegisterMap and pass a reference to it around allowing called functions to obtain their own iter to it.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've restored previous behavior.

Copy link
Contributor

@therealprof therealprof left a comment

Choose a reason for hiding this comment

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

LGTM

bors r+

@bors bors bot merged commit 3767036 into master May 1, 2021
@bors bors bot deleted the reg-iter branch May 1, 2021 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants