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
47 clippy::mutable_key_type,47 clippy::mutable_key_type,
48 // false positives48 // false positives
49 clippy::redundant_pub_crate,49 clippy::redundant_pub_crate,
50 // Sometimes code is fancier without that
51 clippy::manual_let_else,
50)]52)]
5153
52// For jrsonnet-macros54// For jrsonnet-macros
modifiedcrates/jrsonnet-evaluator/src/manifest.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/manifest.rs
+++ b/crates/jrsonnet-evaluator/src/manifest.rs
@@ -211,9 +211,9 @@
 		#[cfg(feature = "exp-bigint")]
 		Val::BigInt(n) => {
 			if options.preserve_bigints {
-				write!(buf, "{n}").unwrap()
+				write!(buf, "{n}").unwrap();
 			} else {
-				write!(buf, "{:?}", n.to_string()).unwrap()
+				write!(buf, "{:?}", n.to_string()).unwrap();
 			}
 		}
 		Val::Arr(items) => {