Open notgull opened 1 year ago
The main issue is that passing around in FFI is a bit awkward for such a type.
I suppose. Although it would be safe to use as the input for a function, and Option<Keysym>
is fully FFI safe.
Ah, yes, that's true. Well, we could do so, I guess, but the thing is that not all crates do Option<Keysym>
and I think you'd need to convert.
X11 generally uses the
NO_KEYSYM
value, as alias for zero, to denote that a keysym is not present. Therefore it would make sense to use aNonZeroU32
as the backing type for theKeysym
type instead ofu32
. This way, forOption<Keysym>
there is no ambiguity betweenNone
andSome(NO_KEYSYM)
.Cons:
None
andSome(NO_KEYSYM)
.