git.delta.rocks / jrsonnet / refs/commits / 99ccb5062b08

difftreelog

feat(evaluator) better context Debug impl

Лач2020-06-25parent: #f3a68fb.patch.diff
in: master

1 file changed

modifiedcrates/jsonnet-evaluator/src/ctx.rsdiffbeforeafterboth
1use crate::{1use crate::{
2 future_wrapper, map::LayeredHashMap, rc_fn_helper, resolved_lazy_val, LazyBinding, LazyVal,2 create_error, future_wrapper, map::LayeredHashMap, rc_fn_helper, resolved_lazy_val, Error,
3 ObjValue, Result, Val,3 LazyBinding, LazyVal, ObjValue, Result, Val,
4};4};
5use std::{cell::RefCell, collections::HashMap, fmt::Debug, rc::Rc};5use std::{cell::RefCell, collections::HashMap, fmt::Debug, rc::Rc};
22impl Debug for Context {22impl Debug for Context {
23 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {23 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
24 f.debug_struct("Context")24 f.debug_struct("Context")
25 .field("this", &self.0.this.clone().map(|e| Rc::as_ptr(&e.0)))25 .field("this", &self.0.this.as_ref().map(|e| Rc::as_ptr(&e.0)))
26 .field("bindings", &self.0.bindings)
26 .finish()27 .finish()
27 }28 }
28}29}