-
Notifications
You must be signed in to change notification settings - Fork 531
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
Fix #961: Change Forth stack return type to slice #1032
Conversation
Closes #961: returning an owned value for a getter that is used for tests only is a bit silly, so this changes the return type of the `Forth::stack` method from `Vec<Value>` to `&[Value]`. It does not require changing the tests. Signed-off-by: Paul Mabileau <[email protected]>
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.
Haha, I'd imagined it would be a bigger change than that!
Me too 😄! |
Actually, I shouldn't have merged quite that quickly. Would you please update |
Okay, I'll get on it then! |
Wait, actually @coriolinus, the stack used in the example surprisingly is a |
Yes, please.
…On Fri, Nov 20, 2020 at 5:17 PM Paul Mabileau ***@***.***> wrote:
Wait, actually @coriolinus <https://github.com/coriolinus>, the stack
used in the example surprisingly is a LinkedList instead of a Vec so
borrowing a slice is impossible... Should we try to refactor the example in
order to use a vector instead?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1032 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB3V4TV2XZSWVL5SN7DESVDSQ2JA3ANCNFSM4T44TT4A>
.
|
Okay, I just didn't know if it was something we could consider |
As discussed in #1032, the PR was merged too quickly, so this is to complete the contribution by updating the exercise's example in order to be compatible with the modified unit tests. Signed-off-by: Paul Mabileau <[email protected]>
Closes #961: as discussed, this adjusts the return type to
&[Value]
in order to reduce the amount of cloning required and since it is used for tests only, it does not truly break the type's API.