File tree 3 files changed +4
-8
lines changed
3 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -516,9 +516,8 @@ pub(crate) fn resolve_identifier<I: Interrupt>(
516
516
} ;
517
517
}
518
518
if let Some ( scope) = scope. clone ( ) {
519
- match scope. get ( ident, context, int) ? {
520
- Some ( val) => return Ok ( val) ,
521
- None => ( ) ,
519
+ if let Some ( val) = scope. get ( ident, context, int) ? {
520
+ return Ok ( val) ;
522
521
}
523
522
}
524
523
if let Some ( val) = context. variables . get ( ident. as_str ( ) ) {
Original file line number Diff line number Diff line change @@ -731,10 +731,7 @@ impl Value {
731
731
}
732
732
733
733
// remove units with exponent == 0
734
- res_components = res_components
735
- . into_iter ( )
736
- . filter ( |unit_exponent| unit_exponent. exponent != 0 . into ( ) )
737
- . collect ( ) ;
734
+ res_components. retain ( |unit_exponent| unit_exponent. exponent != 0 . into ( ) ) ;
738
735
739
736
Ok ( Self {
740
737
value : res_value,
Original file line number Diff line number Diff line change @@ -370,7 +370,7 @@ impl Value {
370
370
} ) ;
371
371
}
372
372
Self :: Fn ( name, expr, _scope) => {
373
- let expr_str = ( & * * expr) . format ( ctx, int) ?;
373
+ let expr_str = expr. format ( ctx, int) ?;
374
374
let res = if name. as_str ( ) . contains ( '.' ) {
375
375
format ! ( "{name}:{expr_str}" )
376
376
} else {
You can’t perform that action at this time.
0 commit comments