Skip to content

Commit 66031a6

Browse files
committed
more clippy
1 parent 3562727 commit 66031a6

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

probe-plotter-tools/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,10 @@ pub fn parse(elf_bytes: &[u8]) -> (Vec<Metric>, Vec<Setting>, rtt::ScanRegion) {
161161
Some(expr_str) => {
162162
let expr = ShuntingParser::parse_str(expr_str).unwrap();
163163
let math_ctx = MathContext::new();
164-
math_ctx.setvar(&math_ctx_variable_name, shunting::MathOp::Number(0.0));
164+
math_ctx.setvar(math_ctx_variable_name, shunting::MathOp::Number(0.0));
165165
math_ctx
166166
.eval(&expr)
167-
.expect(&format!("For metric: {name}, failed to evaluate {expr:?}, Use the metrics name as name for the value in the expression"));
167+
.unwrap_or_else(|_| panic!("For metric: {name}, failed to evaluate {expr:?}, Use the metrics name as name for the value in the expression"));
168168
Some(expr)
169169
}
170170
None => None,

probe-plotter-tools/src/metric.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ impl Metric {
4141
base_expression,
4242
offset,
4343
} => {
44-
let a = match math_ctx.eval(&base_expression) {
44+
let a = match math_ctx.eval(base_expression) {
4545
Ok(0.0) => {
4646
// Address not yet available
4747
return Ok(());

0 commit comments

Comments
 (0)