@@ -35,7 +35,7 @@ use crate::{Evdev, hotplug::HotplugMonitor};
3535///
3636/// for res in enumerate()? {
3737/// let (path, evdev) = res?;
38- /// println!("{}: {}", path.display(), evdev.name()? );
38+ /// println!("{}: {:? }", path.display(), evdev.name());
3939/// }
4040/// # Ok::<_, std::io::Error>(())
4141/// ```
@@ -65,7 +65,7 @@ pub fn enumerate() -> io::Result<Enumerate> {
6565///
6666/// for res in enumerate_hotplug()? {
6767/// let (path, evdev) = res?;
68- /// println!("{}: {}", path.display(), evdev.name()? );
68+ /// println!("{}: {:? }", path.display(), evdev.name());
6969/// }
7070/// # Ok::<_, std::io::Error>(())
7171/// ```
@@ -120,6 +120,8 @@ impl Iterator for Enumerate {
120120 Ok ( dev) => return Some ( Ok ( ( path, dev) ) ) ,
121121 // If a device is unplugged in the middle of enumeration (before it can be opened),
122122 // skip it, since yielding this error to the application is pretty useless.
123+ // Note that callers still have to handle the device disappearing immediately,
124+ // which is surfaced as getting `ENODEV` from all operations.
123125 Err ( e) if e. kind ( ) == io:: ErrorKind :: NotFound => continue ,
124126 Err ( e) => return Some ( Err ( e) ) ,
125127 }
0 commit comments