Function clippy::utils::snippet_block [] [src]

pub fn snippet_block<'a, T: LintContext>(cx: &T, span: Span, default: &'a str) -> Cow<'a, str>

convert a span (from a block) to a code snippet if available, otherwise use default, e.g. snippet(cx, expr.span, "..") This trims the code of indentation, except for the first line Use it for blocks or block-like things which need to be printed as such