From 8a683442a5d784d953f2a88701fe874d9656ac54 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Mon, 12 Jul 2021 18:00:25 +0000 Subject: [PATCH] fix: bounds type error syntax --- --- a/crates/jrsonnet-evaluator/src/typed.rs +++ b/crates/jrsonnet-evaluator/src/typed.rs @@ -30,7 +30,11 @@ MissingProperty(Rc, ComplexValType), #[error("every failed from {0}:\n{1}")] UnionFailed(ComplexValType, TypeLocErrorList), - #[error("number out of bounds: {0} not in {1:?}..{2:?}")] + #[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()), + )] BoundsFailed(f64, Option, Option), } impl From for LocError { @@ -56,7 +60,7 @@ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{}", self.0)?; if !(self.1).0.is_empty() { - write!(f, "at {}", self.1)?; + write!(f, " at {}", self.1)?; } Ok(()) } -- gitstuff