-
Notifications
You must be signed in to change notification settings - Fork 8
tests: Add test of repeated adding of the same extension #539
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
Conversation
let mut windows = nodes.windows(2); | ||
while let Some(&[src, tgt]) = windows.next() { | ||
hugr.connect(src, 0, tgt, 0)?; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Validate it afterwards? Where would a broken inference fail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops! 🤦
src/extension/infer.rs
Outdated
// Connect nodes in order (0 -> 1 -> 2 ...) | ||
let nodes = [node0, node1, node2, node3, node4, node5]; | ||
let mut windows = nodes.windows(2); | ||
while let Some(&[src, tgt]) = windows.next() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be for &[src, tgt] in nodes.windows(2) {...}
or something like that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately that doesn't work quite as well because rust doesn't know at compile time the size of the window and complains that &[src, tgt]
is a refutable pattern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use `tuple_windows instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌
3e668ac
to
2228d35
Compare
2228d35
to
87d9345
Compare
No description provided.