Skip to content

Commit

Permalink
fix: preserve_order arg defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
CertainLach committed May 1, 2024
1 parent 442bce6 commit ea99ae6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions crates/jrsonnet-stdlib/src/arrays.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ pub fn builtin_flatten_deep_array(value: Val) -> Result<Vec<Val>> {
#[builtin]
pub fn builtin_prune(
a: Val,

#[default(false)]
#[cfg(feature = "exp-preserve-order")]
preserve_order: bool,
Expand Down
9 changes: 7 additions & 2 deletions crates/jrsonnet-stdlib/src/objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ pub fn builtin_object_values_ex(
o: ObjValue,
include_hidden: bool,

#[cfg(feature = "exp-preserve-order")] preserve_order: bool,
#[default(false)]
#[cfg(feature = "exp-preserve-order")]
preserve_order: bool,
) -> ArrValue {
o.values_ex(
include_hidden,
Expand Down Expand Up @@ -99,7 +101,10 @@ pub fn builtin_object_values_all(
pub fn builtin_object_keys_values_ex(
o: ObjValue,
include_hidden: bool,
#[cfg(feature = "exp-preserve-order")] preserve_order: bool,

#[default(false)]
#[cfg(feature = "exp-preserve-order")]
preserve_order: bool,
) -> ArrValue {
o.key_values_ex(
include_hidden,
Expand Down

0 comments on commit ea99ae6

Please sign in to comment.