3 ms·
Which is still not safe enough, and in effect can be used to access any global variable as described in the OP article. Rust formatting is done by macros - whi
by unscaled 10y ago
Which is still not safe enough, and in effect can be used to access any global variable as described in the OP article.
Rust formatting is done by macros - which expand at compile time and accept only string literals. This makes it impossible to pass user input to format!(), println!() and their ilk unless the end-user can access your compiler, in which case you have a much larger problem.
- steveklabnik 10y agoThere are crates like https://crates.io/crates/strfmt https://crates.io/crates/strfmt which let you accept a non-literal.