rust-x-bindings / xkbcommon-rs

bindings and safe wrappers for libxkbcommon
MIT License
20 stars 24 forks source link

new_from_fd could return a Result with an error #26

Closed i509VCB closed 2 years ago

i509VCB commented 2 years ago

At the moment, new_from_fd returns an Option<Keymap>. The underlying implementation performs an mmap on the file descriptor to load the keymap.

The mmap could fail of course. Panicking is a fine response to this, but I would prefer being able to get the io::Error resulting from the failed mmap.