MCPcopy Create free account
hub / github.com/bootc-dev/bootc / format_lint_err_from_items

Function format_lint_err_from_items

crates/lib/src/lints.rs:252–264  ·  view source on GitHub ↗

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>,
)

Source from the content-addressed store, hash-verified

250// The closure `build_message_fn` is responsible for calling `format_items`
251// to populate the message buffer.
252fn format_lint_err_from_items<T>(
253 config: &LintExecutionConfig,
254 header: &str,
255 items: impl Iterator<Item = T>,
256) -> LintResult
257where
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
266fn lint_inner<'skip>(
267 root: &Dir,

Callers 3

check_varlogFunction · 0.85
check_bootFunction · 0.85
check_runtime_only_dirsFunction · 0.85

Calls 2

format_itemsFunction · 0.85
lint_errFunction · 0.85

Tested by

no test coverage detected