Try find port type in parent device#170
Conversation
RossSmyth
left a comment
There was a problem hiding this comment.
I would highly recommend not bringing in regex for such an operation due to its extreme compilation weight & size cost.
|
Review is tied with #201 |
|
Thank you for creating this PR @soiamsoNG! Looking at the MODALIAS strings is definitely something we can do for improving finding a certain device in a Docker environment. I agree with @RossSmyth, that using the regex crate is - despite its convenience - on the heavy side. #168 contains measurements showing a significant reduction of built times for Windows by switching to regex-lite. We are currently also evaluating custom parsing of similar strings in #201 and it looks to me at a first glance that we have a good chance to get away with a much simpler parsing for MODALIAS strings than using regex or regex-lite. Looking at |
There is no special requirement for having them there and they are cluttering up the match statement.
|
Thank you @soiamsoNG and @RossSmyth for your contributions! |
for docker enviroment udev not run well for device add by --device
without ID_BUS like ID* property, but we still can try find the must info from its parent.
below is sample output from udevadm info -t /dev/ttyACM0