File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ pub fn is_shift_binop(b: BinOp) -> bool {
85
85
}
86
86
}
87
87
88
- /// Returns `true` is the binary operator takes its arguments by value
88
+ /// Returns `true` if the binary operator takes its arguments by value
89
89
pub fn is_by_value_binop ( b : BinOp ) -> bool {
90
90
match b {
91
91
BiAdd | BiSub | BiMul | BiDiv | BiRem | BiBitXor | BiBitAnd | BiBitOr | BiShl | BiShr => {
@@ -95,6 +95,14 @@ pub fn is_by_value_binop(b: BinOp) -> bool {
95
95
}
96
96
}
97
97
98
+ /// Returns `true` if the unary operator takes its argument by value
99
+ pub fn is_by_value_unop ( u : UnOp ) -> bool {
100
+ match u {
101
+ UnNeg | UnNot => true ,
102
+ _ => false ,
103
+ }
104
+ }
105
+
98
106
pub fn unop_to_string ( op : UnOp ) -> & ' static str {
99
107
match op {
100
108
UnUniq => "box() " ,
You can’t perform that action at this time.
0 commit comments