Skip to content
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(remap): add support for literal arrays #5278

Merged
merged 1 commit into from Dec 3, 2020

Conversation

JeanMertz
Copy link
Contributor

Add support for literal arrays:

.foo = ["foo", 5, ["bar"]]

closes #5219

@JeanMertz JeanMertz added type: enhancement A value-adding code change that enhances its existing functionality. domain: vrl Anything related to the Vector Remap Language labels Nov 28, 2020
@JeanMertz JeanMertz assigned JeanMertz and unassigned StephenWakely and bruceg Nov 30, 2020
.foo
"#,
Ok(()),
Ok(vec!["foo".into(), 5.into(), Value::Array(vec!["bar".into()])].into()),
Copy link
Contributor

Choose a reason for hiding this comment

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

I added an array! macro that saves you from typing .into() for every element. Would be useful here..

https://github.com/timberio/vector/blob/master/src/test_util/mod.rs#L542

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sweet 👌

Copy link
Contributor

@StephenWakely StephenWakely left a comment

Choose a reason for hiding this comment

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

Nice.

Signed-off-by: Jean Mertz <git@jeanmertz.com>
@JeanMertz JeanMertz merged commit e192649 into master Dec 3, 2020
@JeanMertz JeanMertz deleted the jean/remap-arrays branch December 3, 2020 11:15
mengesb pushed a commit to jacobbraaten/vector that referenced this pull request Dec 9, 2020
Signed-off-by: Brian Menges <brian.menges@anaplan.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: vrl Anything related to the Vector Remap Language type: enhancement A value-adding code change that enhances its existing functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

remap-lang: add support for array literals
3 participants