::fstrings
Basic fstring interpolation in Rust
The interpolation works as follows:
-
if the (template) string literal contains a named parameters (e.g.
{name}
) -
and no
name = value
argument is fed to the formatting call, -
then an automatic
name = name
argument is added, so that the variable is effectively interpolated from the current scope.
Example
extern crate fstrings;