-
Notifications
You must be signed in to change notification settings - Fork 72
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
enhancement(stdlib): Add support for keys
parameter to object_from_array
#1176
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.
Thanks, this is a nice utility function.
src/stdlib/object_from_array.rs
Outdated
@@ -1,27 +1,39 @@ | |||
use super::util::ConstOrExpr; | |||
use crate::compiler::prelude::*; | |||
|
|||
fn make_object(values: Vec<Value>) -> Resolved { | |||
fn make_object1(values: Vec<Value>) -> Resolved { |
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.
nit:
fn make_object1(values: Vec<Value>) -> Resolved { | |
fn make_object_1(values: Vec<Value>) -> Resolved { |
src/stdlib/object_from_array.rs
Outdated
values | ||
.into_iter() | ||
.map(make_key_value) | ||
.collect::<Result<_, _>>() | ||
.map(Value::Object) | ||
} | ||
|
||
fn make_object2(keys: Vec<Value>, values: Vec<Value>) -> Resolved { |
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.
fn make_object2(keys: Vec<Value>, values: Vec<Value>) -> Resolved { | |
fn make_object_2(keys: Vec<Value>, values: Vec<Value>) -> Resolved { |
Summary
Continuing #1164
Change Type
Is this a breaking change?
How did you test this PR?
Does this PR include user facing changes?
our guidelines.
Checklist
run
dd-rust-license-tool write
and commit the changes. More details here.References
#1157