File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -411,9 +411,7 @@ impl ConstScalarOrPath {
411
411
}
412
412
ast:: Expr :: PrefixExpr ( prefix_expr) => match prefix_expr. op_kind ( ) {
413
413
Some ( ast:: UnaryOp :: Neg ) => {
414
- let unsigned = prefix_expr
415
- . expr ( )
416
- . map_or ( Self :: Scalar ( ConstScalar :: Unknown ) , Self :: from_expr) ;
414
+ let unsigned = Self :: from_expr_opt ( prefix_expr. expr ( ) ) ;
417
415
// Add sign
418
416
match unsigned {
419
417
Self :: Scalar ( ConstScalar :: UInt ( num) ) => {
@@ -422,7 +420,7 @@ impl ConstScalarOrPath {
422
420
other => other,
423
421
}
424
422
}
425
- _ => prefix_expr. expr ( ) . map_or ( Self :: Scalar ( ConstScalar :: Unknown ) , Self :: from_expr ) ,
423
+ _ => Self :: from_expr_opt ( prefix_expr. expr ( ) ) ,
426
424
} ,
427
425
ast:: Expr :: Literal ( literal) => Self :: Scalar ( match literal. kind ( ) {
428
426
ast:: LiteralKind :: IntNumber ( num) => {
You can’t perform that action at this time.
0 commit comments