From dc11634aca9cc3d5d060263d01e0a4dcaf495070 Mon Sep 17 00:00:00 2001 From: Simon Johnston Date: Tue, 18 Aug 2020 12:35:53 -0700 Subject: [PATCH] const-ed the "usb" string --- src/bin/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bin/main.rs b/src/bin/main.rs index b7b486b..ab3b0e2 100644 --- a/src/bin/main.rs +++ b/src/bin/main.rs @@ -45,6 +45,8 @@ pub(crate) enum SubCommand { Off, } +const DEVICE_CONNECTION_USB: &str = "usb"; + fn main() -> Result<(), Box> { let args = CommandLine::from_args(); @@ -59,7 +61,7 @@ fn main() -> Result<(), Box> { }) .init(); - if args.device == "usb" { + if args.device == DEVICE_CONNECTION_USB { let discovery = USBDeviceDiscovery::new()?; let device = discovery.device()?; debug!("USB device: '{}'", device.id());