ryankurte / rust-streamdeck

libusb based driver for Elgato StreamDeck devices
Mozilla Public License 2.0
57 stars 24 forks source link

Make u16_parse_hex() public #25

Open AleksanderZdunek opened 1 year ago

AleksanderZdunek commented 1 year ago

Silence dead code warning when building lib with --no-default-features.

ryankurte commented 1 year ago

hey thanks for the PR! perhaps rather than exporting it would make sense to feature gate the function with #[cfg(feature = "structopt")]?

AleksanderZdunek commented 1 year ago

I have a copy of that function in my command line application because I used yours as an example and needed to parse the pid in the same way. So it makes some kind of sense to me to provide it by the lib. I don't know which alternative is better.

ryankurte commented 1 year ago

ahh interesting, and you weren't able to include the filters object directly with a #[clap(flatten)] attribute to un-nest it? (though it looks like i'm overdue a swap from structopt to clap).

if that doesn't work for you then yeah lets export it, but it'd be great to have a comment there on what it's for / why.

AleksanderZdunek commented 1 year ago

Added a documentation comment for u16_parse_hex().

Flattening the filters object wouldn't work anyway when building with default-features = false. I have no need to build the example application in production. If it was me I would have probably tried to separate the command line helpers from the backend library, but that's a different matter. :)