(&self, f: &mut Formatter)
| 94 | |
| 95 | impl Display for TrapCode { |
| 96 | fn fmt(&self, f: &mut Formatter) -> fmt::Result { |
| 97 | let identifier = match *self { |
| 98 | Self::STACK_OVERFLOW => "stk_ovf", |
| 99 | Self::HEAP_OUT_OF_BOUNDS => "heap_oob", |
| 100 | Self::INTEGER_OVERFLOW => "int_ovf", |
| 101 | Self::INTEGER_DIVISION_BY_ZERO => "int_divz", |
| 102 | Self::BAD_CONVERSION_TO_INTEGER => "bad_toint", |
| 103 | TrapCode(x) => return write!(f, "user{x}"), |
| 104 | }; |
| 105 | f.write_str(identifier) |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | impl FromStr for TrapCode { |