Strings are not optimized as vector of characters #75618
Open
Description
opened on Aug 17, 2020
This might be a long shot, but it would be really nice if Rust could do this. I'm working on an embedded application, where I draw some text. For a single symbol, I need to use a different font than I use to draw the rest of the text. Right now, Rust doesn't know that I use a single character and the binary contains all of the unnecessary text processing code to map that character to an index and to draw it.
It would be really cool if Rust could recognize that my string is a constant instead of a black box value.
I've reduced an example: https://rust.godbolt.org/z/GrnE79
Activity