| 172 | |
| 173 | impl fmt::Display for Operation { |
| 174 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
| 175 | let operation_name = if let Operation::Custom(custom_op) = self { |
| 176 | custom_op.get_name() |
| 177 | } else { |
| 178 | let operation_w_type_str = format!("{:?}", *self); |
| 179 | let split_for_operation = operation_w_type_str.split('('); |
| 180 | let vec_operation_and_types: Vec<&str> = split_for_operation.collect(); |
| 181 | if vec_operation_and_types.is_empty() { |
| 182 | "-null-".to_owned() |
| 183 | } else { |
| 184 | vec_operation_and_types[0].to_owned() |
| 185 | } |
| 186 | }; |
| 187 | write!(f, "{operation_name}") |
| 188 | } |
| 189 | } |
| 190 | |
| 191 | impl Operation { |