git.delta.rocks / jrsonnet / refs/commits / 696afe01731f

difftreelog

style fix clippy warnings

Yaroslav Bolyukin2021-11-27parent: #a7408d3.patch.diff
in: master

3 files changed

modifiedcrates/jrsonnet-evaluator/src/gc.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/gc.rs
+++ b/crates/jrsonnet-evaluator/src/gc.rs
@@ -18,7 +18,7 @@
 	}
 
 	fn is_type_tracked() -> bool {
-		return true;
+		true
 	}
 }
 
@@ -101,6 +101,11 @@
 		&mut self.0
 	}
 }
+impl<V> Default for GcHashSet<V> {
+	fn default() -> Self {
+		Self::new()
+	}
+}
 
 #[derive(Clone)]
 pub struct GcHashMap<K, V>(pub FxHashMap<K, V>);
@@ -139,3 +144,8 @@
 		&mut self.0
 	}
 }
+impl<K, V> Default for GcHashMap<K, V> {
+	fn default() -> Self {
+		Self::new()
+	}
+}
modifiedcrates/jrsonnet-evaluator/src/lib.rsdiffbeforeafterboth
125 evaluated: Option<Val>,125 evaluated: Option<Val>,
126}126}
127127
128#[allow(clippy::type_complexity)]
128pub struct Breakpoint {129pub struct Breakpoint {
129 loc: ExprLocation,130 loc: ExprLocation,
130 collected: RefCell<HashMap<usize, (usize, Vec<Result<Val>>)>>,131 collected: RefCell<HashMap<usize, (usize, Vec<Result<Val>>)>>,
254 ro_map.get(name).map(|value| value.source_code.clone())255 ro_map.get(name).map(|value| value.source_code.clone())
255 }256 }
256 pub fn map_source_locations(&self, file: &Path, locs: &[usize]) -> Vec<CodeLocation> {257 pub fn map_source_locations(&self, file: &Path, locs: &[usize]) -> Vec<CodeLocation> {
257 offset_to_location(&self.get_source(file).unwrap_or("".into()), locs)258 offset_to_location(&self.get_source(file).unwrap_or_else(|| "".into()), locs)
258 }259 }
259 pub fn map_from_source_location(260 pub fn map_from_source_location(
260 &self,261 &self,
396 data.stack_generation += 1;397 data.stack_generation += 1;
397 result = data398 result = data
398 .breakpoints399 .breakpoints
399 .insert(data.stack_depth, data.stack_generation, &e, result);400 .insert(data.stack_depth, data.stack_generation, e, result);
400 }401 }
401 if let Err(mut err) = result {402 if let Err(mut err) = result {
402 err.trace_mut().0.push(StackTraceElement {403 err.trace_mut().0.push(StackTraceElement {
486 pub fn manifest(&self, val: Val) -> Result<IStr> {487 pub fn manifest(&self, val: Val) -> Result<IStr> {
487 self.run_in_state(|| {488 self.run_in_state(|| {
488 push_description_frame(489 push_description_frame(
489 || format!("manifestification"),490 || "manifestification".to_string(),
490 || val.manifest(&self.manifest_format()),491 || val.manifest(&self.manifest_format()),
491 )492 )
492 })493 })
640}641}
641642
642pub fn cc_ptr_eq<T>(a: &Cc<T>, b: &Cc<T>) -> bool {643pub fn cc_ptr_eq<T>(a: &Cc<T>, b: &Cc<T>) -> bool {
643 let a = &a as &T;644 let a = a as &T;
644 let b = &b as &T;645 let b = b as &T;
645 std::ptr::eq(a, b)646 std::ptr::eq(a, b)
646}647}
647648
modifiedcrates/jrsonnet-evaluator/src/obj.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/obj.rs
+++ b/crates/jrsonnet-evaluator/src/obj.rs
@@ -123,7 +123,7 @@
 			}
 		}
 		for (name, member) in self.0.this_entries.iter() {
-			if handler(name, &member) {
+			if handler(name, member) {
 				return true;
 			}
 		}