difftreelog
style fix clippy warnings
in: master
5 files changed
crates/jrsonnet-evaluator/src/builtin/mod.rsdiffbeforeafterboth--- a/crates/jrsonnet-evaluator/src/builtin/mod.rs
+++ b/crates/jrsonnet-evaluator/src/builtin/mod.rs
@@ -466,8 +466,7 @@
0, name: ty!(string) => Val::Str;
1, rest: ty!(any);
], {
-
- Ok(DebugGcTraceValue::new(name, rest))
+ Ok(DebugGcTraceValue::create(name, rest))
})
}
crates/jrsonnet-evaluator/src/evaluate.rsdiffbeforeafterboth--- a/crates/jrsonnet-evaluator/src/evaluate.rs
+++ b/crates/jrsonnet-evaluator/src/evaluate.rs
@@ -127,8 +127,8 @@
impl Bindable for BindableMethod {
fn bind(&self, this: Option<ObjValue>, super_obj: Option<ObjValue>) -> Result<LazyVal> {
Ok(LazyVal::new(Box::new(BindableMethodLazyVal {
- this: this.clone(),
- super_obj: super_obj.clone(),
+ this,
+ super_obj,
context_creator: self.context_creator.clone(),
name: self.name.clone(),
@@ -586,7 +586,7 @@
add: false,
visibility: Visibility::Normal,
invoke: LazyBinding::Bindable(Gc::new(Box::new(ObjCompBinding {
- context: ctx.clone(),
+ context: ctx,
value: obj.value.clone(),
}))),
location: obj.value.1.clone(),
crates/jrsonnet-evaluator/src/integrations/serde.rsdiffbeforeafterboth--- a/crates/jrsonnet-evaluator/src/integrations/serde.rs
+++ b/crates/jrsonnet-evaluator/src/integrations/serde.rs
@@ -1,6 +1,6 @@
use crate::{
error::{Error::*, LocError, Result},
- throw, Context, LazyBinding, LazyVal, ObjMember, ObjValue, Val,
+ throw, LazyBinding, LazyVal, ObjMember, ObjValue, Val,
};
use gc::Gc;
use jrsonnet_parser::Visibility;
@@ -42,7 +42,7 @@
Self::Object(out)
}
Val::Func(_) => throw!(RuntimeError("tried to manifest function".into())),
- Val::DebugGcTraceValue(v) => Value::try_from(&*v.value as &Val)?,
+ Val::DebugGcTraceValue(v) => Self::try_from(&*v.value as &Val)?,
})
}
}
crates/jrsonnet-evaluator/src/obj.rsdiffbeforeafterboth--- a/crates/jrsonnet-evaluator/src/obj.rs
+++ b/crates/jrsonnet-evaluator/src/obj.rs
@@ -1,7 +1,7 @@
-use crate::{evaluate_add_op, evaluate_assert, Context, LazyBinding, Result, Val};
+use crate::{evaluate_add_op, LazyBinding, Result, Val};
use gc::{Finalize, Gc, GcCell, Trace};
use jrsonnet_interner::IStr;
-use jrsonnet_parser::{AssertStmt, ExprLocation, Visibility};
+use jrsonnet_parser::{ExprLocation, Visibility};
use rustc_hash::{FxHashMap, FxHashSet};
use std::hash::{Hash, Hasher};
use std::{fmt::Debug, hash::BuildHasherDefault};
crates/jrsonnet-evaluator/src/val.rsdiffbeforeafterboth49 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),