Skip to main content

format_banner

Function format_banner 

Source
pub fn format_banner(rules: &[NewRule], prev_label: &str) -> String
Expand description

Build the banner from rule rows + the previous-session label. prev_label is either an RFC-3339 timestamp (“2026-05-20T14:30:00Z”) or the synthetic phrase “the start of this repo” used on first session — formatter doesn’t care which, it just inlines whatever the caller computed.

Returns a single string with embedded \ns. Trailing newline is intentionally absent: the adapters append directly to other context blocks and the caller can add separators.