Skip to main content

source_code_slice

Function source_code_slice 

Source
pub fn source_code_slice(s: impl Into<Cow<'static, str>>) -> Doc
Expand description

A verbatim slice of source that may span multiple lines. Use this — not text — for fallback regions that can contain embedded newlines: it re-bases the column at each newline so the slice stays aligned under indentation, and caches its last line’s display width for fit decisions.