difftreelog
fix manifest formats
in: master
4 files changed
crates/jrsonnet-evaluator/src/manifest.rsdiffbeforeafterboth241 Minify => {}241 Minify => {}242 };242 };243243244 buf.push_str(cur_padding);245 State::push_description(244 State::push_description(246 || format!("elem <{i}> manifestification"),245 || format!("elem <{i}> manifestification"),247 || manifest_json_ex_buf(&item, buf, cur_padding, options),246 || manifest_json_ex_buf(&item, buf, cur_padding, options),298 buf.push_str(options.newline);297 buf.push_str(options.newline);299 buf.push_str(cur_padding);298 buf.push_str(cur_padding);300 }299 }301 ToString => buf.push(' '),300 ToString if i != 0 => buf.push(' '),302 Minify => {}301 Minify | ToString => {}303 }302 }304303305 escape_string_json_buf(&key, buf);304 escape_string_json_buf(&key, buf);crates/jrsonnet-stdlib/src/lib.rsdiffbeforeafterboth--- a/crates/jrsonnet-stdlib/src/lib.rs
+++ b/crates/jrsonnet-stdlib/src/lib.rs
@@ -164,7 +164,7 @@
("objectRemoveKey", builtin_object_remove_key::INST),
// Manifest
("escapeStringJson", builtin_escape_string_json::INST),
- ("escapeStringPython", builtin_escape_string_json::INST),
+ ("escapeStringPython", builtin_escape_string_python::INST),
("escapeStringXML", builtin_escape_string_xml::INST),
("manifestJsonEx", builtin_manifest_json_ex::INST),
("manifestJson", builtin_manifest_json::INST),
crates/jrsonnet-stdlib/src/manifest/mod.rsdiffbeforeafterboth--- a/crates/jrsonnet-stdlib/src/manifest/mod.rs
+++ b/crates/jrsonnet-stdlib/src/manifest/mod.rs
@@ -19,6 +19,11 @@
}
#[builtin]
+pub fn builtin_escape_string_python(str: IStr) -> Result<String> {
+ Ok(escape_string_json(&str))
+}
+
+#[builtin]
pub fn builtin_manifest_json_ex(
value: Val,
indent: String,
@@ -164,13 +169,13 @@
}
#[builtin]
pub fn builtin_manifest_python_vars(
- v: Val,
+ conf: Val,
#[default(false)]
#[cfg(feature = "exp-preserve-order")]
preserve_order: bool,
) -> Result<String> {
- v.manifest(PythonVarsFormat::std(
+ conf.manifest(PythonVarsFormat::std(
#[cfg(feature = "exp-preserve-order")]
preserve_order,
))
crates/jrsonnet-stdlib/src/strings.rsdiffbeforeafterboth--- a/crates/jrsonnet-stdlib/src/strings.rs
+++ b/crates/jrsonnet-stdlib/src/strings.rs
@@ -37,8 +37,8 @@
}
#[builtin]
-pub fn builtin_escape_string_dollars(str: String) -> String {
- str.replace('$', "$$")
+pub fn builtin_escape_string_dollars(str_: String) -> String {
+ str_.replace('$', "$$")
}
#[builtin]