evdevil 0.4.0

Bindings to Linux' input device APIs: evdev and uinput
Documentation
1
2
3
4
5
6
7
8
9
pub fn on_drop(f: impl FnOnce()) -> impl Drop {
    struct Dropper<F: FnOnce()>(Option<F>);
    impl<F: FnOnce()> Drop for Dropper<F> {
        fn drop(&mut self) {
            (self.0.take().unwrap())();
        }
    }
    Dropper(Some(f))
}