Skip to content

Commit

Permalink
Remove regex
Browse files Browse the repository at this point in the history
  • Loading branch information
soiamsoNG committed Jul 21, 2024
1 parent 317de09 commit 0cda296
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/posix/enumerate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ fn port_type(d: &libudev::Device) -> Result<SerialPortType> {
// isc 02 (interface subclass)
// ip 00 (interface protocol)
// in 00 (interface number)
#[cfg(all(target_os = "linux", not(target_env = "musl"), feature = "libudev"))]
fn parse_modalias(moda: &str) -> Option<UsbPortInfo> {
// Find the start of the string, will start with "usb:"
let mod_start = moda.find("usb:v")?;
Expand Down Expand Up @@ -691,6 +692,7 @@ cfg_if! {
}
}

#[cfg(all(target_os = "linux", not(target_env = "musl"), feature = "libudev"))]
#[test]
fn parser_modalias() {
const MODALIAS: &str = "usb:v303Ap1001d0101dcEFdsc02dp01ic02isc02ip00in0C";
Expand Down

0 comments on commit 0cda296

Please sign in to comment.