const-ed the "usb" string

This commit is contained in:
Simon Johnston 2020-08-18 12:35:53 -07:00
parent 4b95734faf
commit dc11634aca

View File

@ -45,6 +45,8 @@ pub(crate) enum SubCommand {
Off, Off,
} }
const DEVICE_CONNECTION_USB: &str = "usb";
fn main() -> Result<(), Box<dyn Error>> { fn main() -> Result<(), Box<dyn Error>> {
let args = CommandLine::from_args(); let args = CommandLine::from_args();
@ -59,7 +61,7 @@ fn main() -> Result<(), Box<dyn Error>> {
}) })
.init(); .init();
if args.device == "usb" { if args.device == DEVICE_CONNECTION_USB {
let discovery = USBDeviceDiscovery::new()?; let discovery = USBDeviceDiscovery::new()?;
let device = discovery.device()?; let device = discovery.device()?;
debug!("USB device: '{}'", device.id()); debug!("USB device: '{}'", device.id());