fn find_usb_info(path: &Path) -> Option<PathBuf> {
    for path in path.ancestors() {
        if path.join("manufacturer").exists()
            && path.join("product").exists()
            && path.join("serial").exists()
        {
            return Some(path.into());
        }
    }
    None
}
/// Search upwards for a directory containing device info
/// (manufacturer, product, and serial).
Search upwards for a directory containing device info
(manufacturer, product, and serial).
Search upwards for a directory containing device info ( manufacturer product and serial ) .
fn find_usb_info(path: &Path) -> Option<PathBuf> {
    for path in path.ancestors() {
        if path.join("manufacturer").exists()
            && path.join("product").exists()
            && path.join("serial").exists()
        {
            return Some(path.into());
        }
    }
    None
}
fn find_usb_info ( path : & Path ) -> Option < PathBuf > { for path in path . ancestors ( ) { if path . join ( " " ) . exists ( ) && path . join ( " " ) . exists ( ) && path . join ( " " ) . exists ( ) { return Some ( path . into ( ) ) ; } } None }
Search upwards for a directory containing device info
(manufacturer, product, and serial).
Search upwards for a directory containing device info ( manufacturer product and serial ) .
path
&Path
path
&Path