4 ms·
It is not a shortcut because it can't be implemented without knowing the `Arguments` internals. `format_args!("{}", "boo").as_str()` returns None for example.
by lifthrasiir 2y ago
It is not a shortcut because it can't be implemented without knowing the `Arguments` internals. `format_args!("{}", "boo").as_str()` returns None for example.
- orf 2y agoIt’s a shortcut in the sense that most, if not all optimisations are shortcuts. This one allows you to shortcut the usual formatting machinery if the result of formatting is a static string. Like all shortcuts, it’s not something you can always rely on.
- lifthrasiir 2y agoIt can be used to shortcut the formatting process, the function itself is however not a shortcut in my opinion.
- orf 2y agoInteresting viewpoint: I see this as a distinction without a difference. I’m interested to know why you see it differently? What is its use, if not as a shortcut?