Function clippy_utils::source::snippet [−][src]
Expand description
Converts a span to a code snippet if available, otherwise use default.
This is useful if you want to provide suggestions for your lint or more generally, if you want
to convert a given Span to a str.
Example
ⓘ
snippet(cx, expr.span, "..")