rust-streamdeck icon indicating copy to clipboard operation
rust-streamdeck copied to clipboard

Make u16_parse_hex() public

Open AleksanderZdunek opened this issue 2 years ago • 4 comments

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

AleksanderZdunek avatar May 26 '23 16:05 AleksanderZdunek

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

ryankurte avatar May 29 '23 22:05 ryankurte

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.

AleksanderZdunek avatar Jun 02 '23 16:06 AleksanderZdunek

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.

ryankurte avatar Jun 03 '23 21:06 ryankurte

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. :)

AleksanderZdunek avatar Jun 09 '23 14:06 AleksanderZdunek