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.rsdiffbeforeafterboth164 ("objectRemoveKey", builtin_object_remove_key::INST),164 ("objectRemoveKey", builtin_object_remove_key::INST),165 // Manifest165 // Manifest166 ("escapeStringJson", builtin_escape_string_json::INST),166 ("escapeStringJson", builtin_escape_string_json::INST),167 ("escapeStringPython", builtin_escape_string_json::INST),167 ("escapeStringPython", builtin_escape_string_python::INST),168 ("escapeStringXML", builtin_escape_string_xml::INST),168 ("escapeStringXML", builtin_escape_string_xml::INST),169 ("manifestJsonEx", builtin_manifest_json_ex::INST),169 ("manifestJsonEx", builtin_manifest_json_ex::INST),170 ("manifestJson", builtin_manifest_json::INST),170 ("manifestJson", builtin_manifest_json::INST),crates/jrsonnet-stdlib/src/manifest/mod.rsdiffbeforeafterboth18 Ok(escape_string_json(&str_))18 Ok(escape_string_json(&str_))19}19}2021#[builtin]22pub fn builtin_escape_string_python(str: IStr) -> Result<String> {23 Ok(escape_string_json(&str))24}202521#[builtin]26#[builtin]22pub fn builtin_manifest_json_ex(27pub fn builtin_manifest_json_ex(164}169}165#[builtin]170#[builtin]166pub fn builtin_manifest_python_vars(171pub fn builtin_manifest_python_vars(167 v: Val,172 conf: Val,168173169 #[default(false)]174 #[default(false)]170 #[cfg(feature = "exp-preserve-order")]175 #[cfg(feature = "exp-preserve-order")]171 preserve_order: bool,176 preserve_order: bool,172) -> Result<String> {177) -> Result<String> {173 v.manifest(PythonVarsFormat::std(178 conf.manifest(PythonVarsFormat::std(174 #[cfg(feature = "exp-preserve-order")]179 #[cfg(feature = "exp-preserve-order")]175 preserve_order,180 preserve_order,176 ))181 ))crates/jrsonnet-stdlib/src/strings.rsdiffbeforeafterboth37}37}383839#[builtin]39#[builtin]40pub fn builtin_escape_string_dollars(str: String) -> String {40pub fn builtin_escape_string_dollars(str_: String) -> String {41 str.replace('$', "$$")41 str_.replace('$', "$$")42}42}434344#[builtin]44#[builtin]