git.delta.rocks / jrsonnet / refs/commits / 07648052cee3

difftreelog

style fix clippy warnings

Yaroslav Bolyukin2024-03-03parent: #8193aab.patch.diff
in: master

3 files changed

modifiedcrates/jrsonnet-evaluator/src/evaluate/operator.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/evaluate/operator.rs
+++ b/crates/jrsonnet-evaluator/src/evaluate/operator.rs
@@ -42,7 +42,7 @@
 
 		(Num(v1), Num(v2)) => Val::new_checked_num(v1 + v2)?,
 		#[cfg(feature = "exp-bigint")]
-		(BigInt(a), BigInt(b)) => BigInt(Box::new((&**a).clone() + (&**b).clone())),
+		(BigInt(a), BigInt(b)) => BigInt(Box::new(&**a + &**b)),
 		_ => bail!(BinaryOperatorDoesNotOperateOnValues(
 			BinaryOpType::Add,
 			a.value_type(),
@@ -180,9 +180,9 @@
 
 		// Bigint X Bigint
 		#[cfg(feature = "exp-bigint")]
-		(BigInt(a), Mul, BigInt(b)) => BigInt(Box::new((&**a).clone() * (&**b).clone())),
+		(BigInt(a), Mul, BigInt(b)) => BigInt(Box::new(&**a * &**b)),
 		#[cfg(feature = "exp-bigint")]
-		(BigInt(a), Sub, BigInt(b)) => BigInt(Box::new((&**a).clone() - (&**b).clone())),
+		(BigInt(a), Sub, BigInt(b)) => BigInt(Box::new(&**a - &**b)),
 
 		_ => bail!(BinaryOperatorDoesNotOperateOnValues(
 			op,
modifiedcrates/jrsonnet-evaluator/src/lib.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/lib.rs
+++ b/crates/jrsonnet-evaluator/src/lib.rs
@@ -47,6 +47,8 @@
 	clippy::mutable_key_type,
 	// false positives
 	clippy::redundant_pub_crate,
+	// Sometimes code is fancier without that
+	clippy::manual_let_else,
 )]
 
 // For jrsonnet-macros
modifiedcrates/jrsonnet-evaluator/src/manifest.rsdiffbeforeafterboth
211 #[cfg(feature = "exp-bigint")]211 #[cfg(feature = "exp-bigint")]
212 Val::BigInt(n) => {212 Val::BigInt(n) => {
213 if options.preserve_bigints {213 if options.preserve_bigints {
214 write!(buf, "{n}").unwrap()214 write!(buf, "{n}").unwrap();
215 } else {215 } else {
216 write!(buf, "{:?}", n.to_string()).unwrap()216 write!(buf, "{:?}", n.to_string()).unwrap();
217 }217 }
218 }218 }
219 Val::Arr(items) => {219 Val::Arr(items) => {