Module format_string_exprs

Source
Expand description

Tools to work with expressions present in format string literals for the format_args! family of macros. Primarily meant for assists and completions.

Enums§

Arg
Enum for representing extracted format string args. Can either be extracted expressions (which includes identifiers), or placeholders {}.

Functions§

parse_format_exprs
Parser for a format-like string. It is more allowing in terms of string contents, as we expect variable placeholders to be filled with expressions.
with_placeholders
Add placeholders like $1 and $2 in place of Arg::Placeholder, and unwraps the Arg::Ident and Arg::Expr enums.