-
Notifications
You must be signed in to change notification settings - Fork 228
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
Change map helper functions' arguments #453
Conversation
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.
LGTM! 🚢
keys: &[Term<'a>], | ||
values: &[Term<'a>], | ||
keys: &[impl Encoder], | ||
values: &[impl Encoder], |
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.
Shouldn't this be impl Encoder + 'a
as @hansihe noted?
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.
Encoder::encode
encodes a Rust value into a term bounds to env
's lifetime. So, the arguments actually don't need the lifetime bound!
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.
This looks nice. I am a little confused if we need to take care of the Env
somehow. Users might come up with the idea of passing Term
s into the functions and have different environments for the terms.
resolves #451
Change map's helper functions arguments from
Term
intoimpl Encoder
.