Re:Implementing a Type-safe printf in Rust
by dthul on Friday August 14, 2020 @05:01AM
(#24155552)
The position of arguments is actually not required to follow the format string. From the documentation:
But you are right, you cannot dynamically change the format string.
If you need this facility, there is the runtime_fmt crate which will parse the format string at runtime instead of compile time. That of course means that it can fail at runtime if the format string does not match the arguments.
[ Parent
| on HN ]