|
|
|
|
|
by gefhfffh
1620 days ago
|
|
I know it would need to allocate memory, but from a user perspective that allocation isn't less visible when using f strings instead of the format macro. In your example I would return a String and generate a warning, because the f of the string isn't used. |
|
str (and thus &str) is part of the language, it's a built-in primitive type like i64 or bool, but String is just a struct the alloc crate brings into existence and so it may not be available.