diff --git a/src/lib.rs b/src/lib.rs index 8da614d..baf5918 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -45,7 +45,16 @@ pub struct Filter { pub serial: Option, } -fn u16_parse_hex(s: &str) -> Result { +/// Parse hexadecimal formatted string to integer +/// +/// Helper function for parsing PID and VID command line arguments. +/// +/// #Example +/// ``` +/// #[structopt(parse(try_from_str=streamdeck::u16_parse_hex))] +/// pid: u16, +/// ``` +pub fn u16_parse_hex(s: &str) -> Result { u16::from_str_radix(s, 16) }