const-ed the "usb" string
This commit is contained in:
parent
4b95734faf
commit
dc11634aca
@ -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());
|
||||||
|
Loading…
Reference in New Issue
Block a user