git.delta.rocks / jrsonnet / refs/commits / 6451b30ca5f3

difftreelog

style fix clippy warnings

Yaroslav Bolyukin2021-07-12parent: #8a68344.patch.diff
in: master

2 files changed

modifiedcrates/jrsonnet-evaluator/src/builtin/mod.rsdiffbeforeafterboth
396396
397fn frexp(s: f64) -> (f64, i16) {397fn frexp(s: f64) -> (f64, i16) {
398 if 0.0 == s {398 if 0.0 == s {
399 return (s, 0);399 (s, 0)
400 } else {400 } else {
401 let lg = s.abs().log2();401 let lg = s.abs().log2();
402 let x = (lg - lg.floor() - 1.0).exp2();402 let x = (lg - lg.floor() - 1.0).exp2();
modifiedcrates/jrsonnet-evaluator/src/typed.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/typed.rs
+++ b/crates/jrsonnet-evaluator/src/typed.rs
@@ -32,8 +32,8 @@
 	UnionFailed(ComplexValType, TypeLocErrorList),
 	#[error(
 		"number out of bounds: {0} not in {}..{}",
-		.1.map(|v|v.to_string()).unwrap_or("".to_owned()),
-		.2.map(|v|v.to_string()).unwrap_or("".to_owned()),
+		.1.map(|v|v.to_string()).unwrap_or_else(|| "".to_owned()),
+		.2.map(|v|v.to_string()).unwrap_or_else(|| "".to_owned()),
 	)]
 	BoundsFailed(f64, Option<f64>, Option<f64>),
 }