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
sourceimpl 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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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