Skip to main content

parse_bus_device

Function parse_bus_device 

Source
pub fn parse_bus_device(text: &str) -> Option<(u8, u8)>
Expand description

Parses bus:device as sscanf("%u:%u") would, into USB bus and address.

Whitespace around the bus number is ignored, and the device number ends at its first non-digit, as %u stops there. None if there is no :, either number is missing or not decimal, or either does not fit a u8.