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.rsdiffbeforeafterboth127 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,132132133 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(),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.rsdiffbeforeafterboth--- a/crates/jrsonnet-evaluator/src/val.rs
+++ b/crates/jrsonnet-evaluator/src/val.rs
@@ -49,7 +49,7 @@
pub fn evaluate(&self) -> Result<Val> {
match &*self.0.borrow() {
LazyValInternals::Computed(v) => return Ok(v.clone()),
- LazyValInternals::Errored(e) => return Err(e.clone().into()),
+ LazyValInternals::Errored(e) => return Err(e.clone()),
LazyValInternals::Pending => return Err(RecursiveLazyValueEvaluation.into()),
_ => (),
};
@@ -400,7 +400,7 @@
impl Clone for DebugGcTraceValue {
fn clone(&self) -> Self {
self.print("Cloned");
- let value = DebugGcTraceValue {
+ let value = Self {
name: self.name.clone(),
value: self.value.clone(),
};
@@ -409,7 +409,7 @@
}
}
impl DebugGcTraceValue {
- pub fn new(name: IStr, value: Val) -> Val {
+ pub fn create(name: IStr, value: Val) -> Val {
let value = Self {
name,
value: Box::new(value),