mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-20 07:33:20 +03:00
remove many unwrap and enum_value_or_default
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
@@ -153,10 +153,10 @@ pub fn start() -> ResultType<()> {
|
||||
}
|
||||
|
||||
let exe_file = std::env::current_exe()?;
|
||||
if exe_file.parent().is_none() {
|
||||
let Some(cur_dir) = exe_file
|
||||
.parent() else {
|
||||
bail!("Cannot get parent of current exe file");
|
||||
}
|
||||
let cur_dir = exe_file.parent().unwrap();
|
||||
};
|
||||
|
||||
let dll_file = cur_dir.join("WindowInjection.dll");
|
||||
if !dll_file.exists() {
|
||||
@@ -344,6 +344,7 @@ async fn set_privacy_mode_state(
|
||||
}
|
||||
|
||||
pub(super) mod privacy_hook {
|
||||
|
||||
use super::*;
|
||||
use std::sync::mpsc::{channel, Sender};
|
||||
|
||||
@@ -426,7 +427,7 @@ pub(super) mod privacy_hook {
|
||||
}
|
||||
Err(e) => {
|
||||
// Fatal error
|
||||
tx.send(format!("Unexpected err when hook {}", e)).unwrap();
|
||||
allow_err!(tx.send(format!("Unexpected err when hook {}", e)));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user