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
4242
43 (Num(v1), Num(v2)) => Val::new_checked_num(v1 + v2)?,43 (Num(v1), Num(v2)) => Val::new_checked_num(v1 + v2)?,
44 #[cfg(feature = "exp-bigint")]44 #[cfg(feature = "exp-bigint")]
45 (BigInt(a), BigInt(b)) => BigInt(Box::new((&**a).clone() + (&**b).clone())),45 (BigInt(a), BigInt(b)) => BigInt(Box::new(&**a + &**b)),
46 _ => bail!(BinaryOperatorDoesNotOperateOnValues(46 _ => bail!(BinaryOperatorDoesNotOperateOnValues(
47 BinaryOpType::Add,47 BinaryOpType::Add,
48 a.value_type(),48 a.value_type(),
180180
181 // Bigint X Bigint181 // Bigint X Bigint
182 #[cfg(feature = "exp-bigint")]182 #[cfg(feature = "exp-bigint")]
183 (BigInt(a), Mul, BigInt(b)) => BigInt(Box::new((&**a).clone() * (&**b).clone())),183 (BigInt(a), Mul, BigInt(b)) => BigInt(Box::new(&**a * &**b)),
184 #[cfg(feature = "exp-bigint")]184 #[cfg(feature = "exp-bigint")]
185 (BigInt(a), Sub, BigInt(b)) => BigInt(Box::new((&**a).clone() - (&**b).clone())),185 (BigInt(a), Sub, BigInt(b)) => BigInt(Box::new(&**a - &**b)),
186186
187 _ => bail!(BinaryOperatorDoesNotOperateOnValues(187 _ => bail!(BinaryOperatorDoesNotOperateOnValues(
188 op,188 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
--- 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) => {