--- a/cmds/jrsonnet-fmt/src/main.rs
+++ b/cmds/jrsonnet-fmt/src/main.rs
@@ -356,16 +356,16 @@
impl Printable for Member {
fn print(&self, out: &mut PrintItems) {
match self {
- Member::MemberBindStmt(b) => {
+ Self::MemberBindStmt(b) => {
p!(out, { b.obj_local() })
}
- Member::MemberAssertStmt(ass) => {
+ Self::MemberAssertStmt(ass) => {
p!(out, { ass.assertion() })
}
- Member::MemberFieldNormal(n) => {
+ Self::MemberFieldNormal(n) => {
p!(out, {n.field_name()} if(n.plus_token().is_some())({n.plus_token()}) {n.visibility()} str(" ") {n.expr()})
}
- Member::MemberFieldMethod(m) => {
+ Self::MemberFieldMethod(m) => {
p!(out, {m.field_name()} {m.params_desc()} {m.visibility()} str(" ") {m.expr()})
}
}
--- a/crates/jrsonnet-evaluator/src/manifest.rs
+++ b/crates/jrsonnet-evaluator/src/manifest.rs
@@ -1,6 +1,6 @@
use std::{borrow::Cow, fmt::Write};
-use crate::{bail, Result, State, Val};
+use crate::{bail, Result, ResultExt, State, Val};
pub trait ManifestFormat {
fn manifest_buf(&self, val: Val, buf: &mut String) -> Result<()>;
@@ -235,7 +235,8 @@
}
}
buf.push_str(cur_padding);
- manifest_json_ex_buf(&item?, buf, cur_padding, options)?;
+ manifest_json_ex_buf(&item?, buf, cur_padding, options)
+ .with_description(|| format!("elem <{i}> manifestification"))?;
}
cur_padding.truncate(old_len);
--- a/crates/jrsonnet-evaluator/src/obj.rs
+++ b/crates/jrsonnet-evaluator/src/obj.rs
@@ -278,7 +278,7 @@
}
impl ObjectLike for ThisOverride {
fn with_this(&self, _me: ObjValue, this: ObjValue) -> ObjValue {
- ObjValue::new(ThisOverride {
+ ObjValue::new(Self {
inner: self.inner.clone(),
this,
})
@@ -398,7 +398,7 @@
self.get_for(key, self.0.this().unwrap_or_else(|| self.clone()))
}
- pub fn get_for(&self, key: IStr, this: ObjValue) -> Result