difftreelog
fix yaml stream handling difference
in: master
1 file changed
crates/jrsonnet-stdlib/src/parse.rsdiffbeforeafterboth9910#[builtin]10#[builtin]11pub fn builtin_parse_yaml(str: IStr) -> Result<Val> {11pub fn builtin_parse_yaml(str: IStr) -> Result<Val> {12 let needs_synthetic_null = str.trim_end().ends_with("\n---");1312 let out = serde_saphyr::from_multiple_with_options::<Val>(14 let mut out = serde_saphyr::from_multiple_with_options::<Val>(13 &str,15 &str,14 serde_saphyr::Options {16 serde_saphyr::Options {15 // Golang/C++ compat17 // Golang/C++ compat21 )23 )22 .map_err(|e| runtime_error!("failed to parse yaml: {e}"))?;24 .map_err(|e| runtime_error!("failed to parse yaml: {e}"))?;2526 // saphyr and other yaml implementations disagree on how to handle an empty document in multi-document stream.27 // Saphyr only considers document started after anything is emitted after the document delimiter28 if needs_synthetic_null {29 out.push(Val::Null);30 }3123 Ok(if out.is_empty() {32 Ok(if out.is_empty() {24 Val::Null33 Val::Null