Remove handle_error function
This commit is contained in:
18
src/main.rs
18
src/main.rs
@@ -4,24 +4,6 @@ mod status_tray;
|
|||||||
use hyper_x_cloud_ii_wireless::devices::{connect_compatible_device, DeviceError};
|
use hyper_x_cloud_ii_wireless::devices::{connect_compatible_device, DeviceError};
|
||||||
use status_tray::{StatusTray, TrayHandler};
|
use status_tray::{StatusTray, TrayHandler};
|
||||||
|
|
||||||
fn handle_error(error: DeviceError) -> String {
|
|
||||||
match error {
|
|
||||||
DeviceError::HidError(hidapi::HidError::HidApiError { message }) => {
|
|
||||||
if message == "No such device" {
|
|
||||||
eprintln!("No device found.");
|
|
||||||
"No such device".to_string()
|
|
||||||
} else {
|
|
||||||
eprintln!("{message}");
|
|
||||||
message
|
|
||||||
}
|
|
||||||
}
|
|
||||||
error => {
|
|
||||||
eprintln!("{error}");
|
|
||||||
error.to_string()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let tray_handler = TrayHandler::new(StatusTray::new());
|
let tray_handler = TrayHandler::new(StatusTray::new());
|
||||||
loop {
|
loop {
|
||||||
|
|||||||
Reference in New Issue
Block a user