git.delta.rocks / jrsonnet / refs/commits / b4d770130199

difftreelog

chore use debug-form of strings when printing errors in parse intrinsics

Petr Portnov | PROgrm_JARvis2022-11-23parent: #2d81df4.patch.diff
in: master

1 file changed

modifiedcrates/jrsonnet-stdlib/src/strings.rsdiffbeforeafterboth
50 Ok(str.to_ascii_lowercase())50 Ok(str.to_ascii_lowercase())
51}51}
52
53pub fn repeat(what: Either![IStr, ArrValue], count: i32) {
54 joi
55}
5256
53#[builtin]57#[builtin]
54pub fn builtin_find_substr(pat: IStr, str: IStr) -> Result<ArrValue> {58pub fn builtin_find_substr(pat: IStr, str: IStr) -> Result<ArrValue> {
89 parse_nat::<10>(raw.as_str())93 parse_nat::<10>(raw.as_str())
90 }94 }
91 } else {95 } else {
92 throw!("Empty decimal integer \"{}\"", raw);96 throw!("Empty decimal integer",);
93 }97 }
94}98}
9599
145 if digit < BASE {149 if digit < BASE {
146 Ok(base * aggregate + digit as f64)150 Ok(base * aggregate + digit as f64)
147 } else {151 } else {
148 throw!("\"{raw}\" is not a base {BASE} integer",);152 throw!("{raw:?} is not a base {BASE} integer",);
149 }153 }
150 })154 })
151}155}