git.delta.rocks / jrsonnet / refs/commits / 8766467a8ebe

difftreelog

style fix clippy warnings

Yaroslav Bolyukin2021-06-12parent: #e71a0d8.patch.diff
in: master

5 files changed

modifiedcrates/jrsonnet-evaluator/src/builtin/mod.rsdiffbeforeafterboth
467 1, rest: ty!(any);467 1, rest: ty!(any);
468 ], {468 ], {
469
470 Ok(DebugGcTraceValue::new(name, rest))469 Ok(DebugGcTraceValue::create(name, rest))
471 })470 })
472}471}
473472
modifiedcrates/jrsonnet-evaluator/src/evaluate.rsdiffbeforeafterboth
127 impl Bindable for BindableMethod {127 impl Bindable for BindableMethod {
128 fn bind(&self, this: Option<ObjValue>, super_obj: Option<ObjValue>) -> Result<LazyVal> {128 fn bind(&self, this: Option<ObjValue>, super_obj: Option<ObjValue>) -> Result<LazyVal> {
129 Ok(LazyVal::new(Box::new(BindableMethodLazyVal {129 Ok(LazyVal::new(Box::new(BindableMethodLazyVal {
130 this: this.clone(),130 this,
131 super_obj: super_obj.clone(),131 super_obj,
132132
133 context_creator: self.context_creator.clone(),133 context_creator: self.context_creator.clone(),
134 name: self.name.clone(),134 name: self.name.clone(),
586 add: false,586 add: false,
587 visibility: Visibility::Normal,587 visibility: Visibility::Normal,
588 invoke: LazyBinding::Bindable(Gc::new(Box::new(ObjCompBinding {588 invoke: LazyBinding::Bindable(Gc::new(Box::new(ObjCompBinding {
589 context: ctx.clone(),589 context: ctx,
590 value: obj.value.clone(),590 value: obj.value.clone(),
591 }))),591 }))),
592 location: obj.value.1.clone(),592 location: obj.value.1.clone(),
modifiedcrates/jrsonnet-evaluator/src/integrations/serde.rsdiffbeforeafterboth
1use crate::{1use crate::{
2 error::{Error::*, LocError, Result},2 error::{Error::*, LocError, Result},
3 throw, Context, LazyBinding, LazyVal, ObjMember, ObjValue, Val,3 throw, LazyBinding, LazyVal, ObjMember, ObjValue, Val,
4};4};
5use gc::Gc;5use gc::Gc;
6use jrsonnet_parser::Visibility;6use jrsonnet_parser::Visibility;
42 Self::Object(out)42 Self::Object(out)
43 }43 }
44 Val::Func(_) => throw!(RuntimeError("tried to manifest function".into())),44 Val::Func(_) => throw!(RuntimeError("tried to manifest function".into())),
45 Val::DebugGcTraceValue(v) => Value::try_from(&*v.value as &Val)?,45 Val::DebugGcTraceValue(v) => Self::try_from(&*v.value as &Val)?,
46 })46 })
47 }47 }
48}48}
modifiedcrates/jrsonnet-evaluator/src/obj.rsdiffbeforeafterboth
1use crate::{evaluate_add_op, evaluate_assert, Context, LazyBinding, Result, Val};1use crate::{evaluate_add_op, LazyBinding, Result, Val};
2use gc::{Finalize, Gc, GcCell, Trace};2use gc::{Finalize, Gc, GcCell, Trace};
3use jrsonnet_interner::IStr;3use jrsonnet_interner::IStr;
4use jrsonnet_parser::{AssertStmt, ExprLocation, Visibility};4use jrsonnet_parser::{ExprLocation, Visibility};
5use rustc_hash::{FxHashMap, FxHashSet};5use rustc_hash::{FxHashMap, FxHashSet};
6use std::hash::{Hash, Hasher};6use std::hash::{Hash, Hasher};
7use std::{fmt::Debug, hash::BuildHasherDefault};7use std::{fmt::Debug, hash::BuildHasherDefault};
modifiedcrates/jrsonnet-evaluator/src/val.rsdiffbeforeafterboth
49 pub fn evaluate(&self) -> Result<Val> {49 pub fn evaluate(&self) -> Result<Val> {
50 match &*self.0.borrow() {50 match &*self.0.borrow() {
51 LazyValInternals::Computed(v) => return Ok(v.clone()),51 LazyValInternals::Computed(v) => return Ok(v.clone()),
52 LazyValInternals::Errored(e) => return Err(e.clone().into()),52 LazyValInternals::Errored(e) => return Err(e.clone()),
53 LazyValInternals::Pending => return Err(RecursiveLazyValueEvaluation.into()),53 LazyValInternals::Pending => return Err(RecursiveLazyValueEvaluation.into()),
54 _ => (),54 _ => (),
55 };55 };
400impl Clone for DebugGcTraceValue {400impl Clone for DebugGcTraceValue {
401 fn clone(&self) -> Self {401 fn clone(&self) -> Self {
402 self.print("Cloned");402 self.print("Cloned");
403 let value = DebugGcTraceValue {403 let value = Self {
404 name: self.name.clone(),404 name: self.name.clone(),
405 value: self.value.clone(),405 value: self.value.clone(),
406 };406 };
409 }409 }
410}410}
411impl DebugGcTraceValue {411impl DebugGcTraceValue {
412 pub fn new(name: IStr, value: Val) -> Val {412 pub fn create(name: IStr, value: Val) -> Val {
413 let value = Self {413 let value = Self {
414 name,414 name,
415 value: Box::new(value),415 value: Box::new(value),