-
-
Notifications
You must be signed in to change notification settings - Fork 88
glib: Ergonomics of 'Char' seem questionalble #491
Comments
For reference, So it should be fine to use |
I agree, and also if we keep |
I'm fine with replacing |
@GuillaumeGomez What advantage over using |
|
So I guess |
We can simply add a method on Char: |
So a |
👍 |
See gtk-rs#491 This leaves `fn new()` unchanged. Don't know if it would be better to change or remove that.
See gtk-rs#491 This leaves `fn new()` unchanged. Don't know if it would be better to change or remove that.
The docs suggest this is meant to be more ergonomic that taking
libc:c_char
. But is it an improvement over just acceptingu8
? Rust has ab''
syntax.For the
set_list_separator
example in the documentation:Apparently
u8
doesn't implementTryFrom<char>
(rust-lang/rfcs#2854), which would be useful for panicking behavior similar toglib::Char::new(...).unwrap()
when out of range. But on the whole, accepting au8
seems more ergonomic for most uses.The text was updated successfully, but these errors were encountered: