Adds an arm that doesn't read anythings from the fields to the Match statement.
(&mut self, name: impl Into<String>, body: impl Into<String>)
| 363 | |
| 364 | /// Adds an arm that doesn't read anythings from the fields to the Match statement. |
| 365 | pub fn arm_no_fields(&mut self, name: impl Into<String>, body: impl Into<String>) { |
| 366 | let body = body.into(); |
| 367 | |
| 368 | let name = name.into(); |
| 369 | if name == "_" { |
| 370 | self.set_catch_all(body); |
| 371 | return; |
| 372 | } |
| 373 | |
| 374 | let match_arm = self |
| 375 | .arms |
| 376 | .entry((Vec::new(), body)) |
| 377 | .or_insert_with(BTreeSet::new); |
| 378 | match_arm.insert(name); |
| 379 | } |
| 380 | } |
| 381 | |
| 382 | #[cfg(test)] |