difftreelog
perf move std.lines to native
in: master
3 files changed
crates/jrsonnet-stdlib/src/arrays.rsdiffbeforeafterboth--- a/crates/jrsonnet-stdlib/src/arrays.rs
+++ b/crates/jrsonnet-stdlib/src/arrays.rs
@@ -201,6 +201,14 @@
}
#[builtin]
+pub fn builtin_lines(arr: ArrValue) -> Result<IndexableVal> {
+ builtin_join(
+ IndexableVal::Str("\n".into()),
+ ArrValue::extended(arr, ArrValue::eager(vec![Val::string("")])).into(),
+ )
+}
+
+#[builtin]
pub fn builtin_reverse(arr: ArrValue) -> ArrValue {
arr.reversed()
}
crates/jrsonnet-stdlib/src/lib.rsdiffbeforeafterboth85 ("foldr", builtin_foldr::INST),85 ("foldr", builtin_foldr::INST),86 ("range", builtin_range::INST),86 ("range", builtin_range::INST),87 ("join", builtin_join::INST),87 ("join", builtin_join::INST),88 ("lines", builtin_lines::INST),88 ("reverse", builtin_reverse::INST),89 ("reverse", builtin_reverse::INST),89 ("any", builtin_any::INST),90 ("any", builtin_any::INST),90 ("all", builtin_all::INST),91 ("all", builtin_all::INST),crates/jrsonnet-stdlib/src/std.jsonnetdiffbeforeafterboth--- a/crates/jrsonnet-stdlib/src/std.jsonnet
+++ b/crates/jrsonnet-stdlib/src/std.jsonnet
@@ -11,9 +11,6 @@
else
{ [k]: func(k, obj[k]) for k in std.objectFields(obj) },
- lines(arr)::
- std.join('\n', arr + ['']),
-
deepJoin(arr)::
if std.isString(arr) then
arr