Struct clippy_utils::macros::FormatString
source · pub struct FormatString {
pub span: Span,
pub snippet: String,
pub style: Option<usize>,
pub unescaped: String,
pub parts: Vec<Symbol>,
}
Expand description
The format string doesn’t exist in the HIR, so we reassemble it from source code
Fields§
§span: Span
Span of the whole format string literal, including [r#]"
.
snippet: String
Snippet of the whole format string literal, including [r#]"
.
style: Option<usize>
If the string is raw r"..."
/r#""#
, how many #
s does it have on each side.
unescaped: String
The unescaped value of the format string, e.g. "val – {}"
for the literal
"val \u{2013} {}"
.
parts: Vec<Symbol>
The format string split by format args like {..}
.
Implementations§
source§impl FormatString
impl FormatString
fn new(cx: &LateContext<'_>, pieces: &Expr<'_>) -> Option<Self>
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for FormatString
impl !Send for FormatString
impl !Sync for FormatString
impl Unpin for FormatString
impl UnwindSafe for FormatString
Blanket Implementations§
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 96 bytes