1
0
Fork 0
forked from wry/wry

udev: accept [u8] instead of str

This commit is contained in:
Julian Orth 2026-03-19 22:24:40 +01:00
parent ff177a0721
commit 37a0bd451b
2 changed files with 3 additions and 3 deletions

View file

@ -280,8 +280,8 @@ pub async fn create(state: &Rc<State>) -> Result<Rc<MetalBackend>, MetalError> {
}); });
let udev = Rc::new(Udev::new()?); let udev = Rc::new(Udev::new()?);
let monitor = Rc::new(udev.create_monitor()?); let monitor = Rc::new(udev.create_monitor()?);
monitor.add_match_subsystem_devtype(Some("input"), None)?; monitor.add_match_subsystem_devtype(Some(b"input"), None)?;
monitor.add_match_subsystem_devtype(Some("drm"), None)?; monitor.add_match_subsystem_devtype(Some(b"drm"), None)?;
monitor.enable_receiving()?; monitor.enable_receiving()?;
let libinput = Rc::new(LibInput::new(device_holder.clone())?); let libinput = Rc::new(LibInput::new(device_holder.clone())?);
let monitor_fd = dup_fd(monitor.fd())?; let monitor_fd = dup_fd(monitor.fd())?;

View file

@ -218,7 +218,7 @@ impl UdevMonitor {
pub fn add_match_subsystem_devtype( pub fn add_match_subsystem_devtype(
&self, &self,
subsystem: Option<&str>, subsystem: Option<&[u8]>,
devtype: Option<&str>, devtype: Option<&str>,
) -> Result<(), UdevError> { ) -> Result<(), UdevError> {
let subsystem = subsystem.map(|s| s.into_ustr()); let subsystem = subsystem.map(|s| s.into_ustr());