Add a brace-delimited block that begins with `start`: i.e., ` { }`. This properly indents the contents of the block.
(&mut self, start: &str, f: F)
| 185 | /// Add a brace-delimited block that begins with `start`: i.e., `<start> { |
| 186 | /// <f()> }`. This properly indents the contents of the block. |
| 187 | pub fn add_block<T, F: FnOnce(&mut Formatter) -> T>(&mut self, start: &str, f: F) -> T { |
| 188 | assert!(matches!(self.lang, Language::Rust)); |
| 189 | self.line(format!("{start} {{")); |
| 190 | let ret = self.indent(f); |
| 191 | self.line("}"); |
| 192 | ret |
| 193 | } |
| 194 | |
| 195 | /// Add a match expression. |
| 196 | pub fn add_match(&mut self, m: Match) { |
no test coverage detected