Use helper functions in <LibinputInputBackend as InputBackend>::dipatch_new_events to simplify the code Move said helper functions to libinput/helpers.rs Move libinput.rs to libinput/mod.rs