-
Notifications
You must be signed in to change notification settings - Fork 1
Description
First of all, thank you so much for this library!
I think that SendType should use &[u8] instead of &str for text. Fundamentally, Rust strings are UTF-8, and text you're sending to a display will be in a custom 8-bit encoding (possibly with multiple pages, controlled separately), most definitely not in UTF-8. This leads to very real issues when I want to use my display's additional symbols but Rust prevents me from putting the corresponding literals into strings and iterates over them incorrectly even if I force it to with a bit of unsafe transmutations. Fortunately, it's possible to work around this by calling send manually, but that's what write is supposed to help with in the first place.
If preserving backward compatibility is vital, a new enumeration value in SendType, e.g. Binary could be added. However, I'd say that the current API is technically wrong, and migration is likely to be rather simple anyways.