I have an array of strings like
const LANGUAGES: [&str; 3] = [
"EN",
"ES",
"DE",
];
and I would like to lowercase them at compile time. How can I do that?
I have an array of strings like
const LANGUAGES: [&str; 3] = [
"EN",
"ES",
"DE",
];
and I would like to lowercase them at compile time. How can I do that?
You could do this:
const LANGUAGES: [&'static str; 3] = [
"EN",
"US",
"DE",
];
It works, I've found an explanation of &'static type in this post. However, I do not understand what ' means in itself and why 'static does what it does.
But it works.