Helper to build a lint error message from multiple sections. The closure `build_message_fn` is responsible for calling `format_items` to populate the message buffer.
(
config: &LintExecutionConfig,
header: &str,
items: impl Iterator<Item = T>,
)
| 250 | // The closure `build_message_fn` is responsible for calling `format_items` |
| 251 | // to populate the message buffer. |
| 252 | fn format_lint_err_from_items<T>( |
| 253 | config: &LintExecutionConfig, |
| 254 | header: &str, |
| 255 | items: impl Iterator<Item = T>, |
| 256 | ) -> LintResult |
| 257 | where |
| 258 | T: Display, |
| 259 | { |
| 260 | let mut msg = String::new(); |
| 261 | // SAFETY: Writing to a string can't fail |
| 262 | format_items(config, header, items, &mut msg).unwrap(); |
| 263 | lint_err(msg) |
| 264 | } |
| 265 | |
| 266 | fn lint_inner<'skip>( |
| 267 | root: &Dir, |
no test coverage detected