remove expect

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2023-01-02 13:11:21 +08:00
parent 4edcf4c412
commit 97718b33a6
5 changed files with 15 additions and 7 deletions

View File

@@ -88,7 +88,13 @@ impl Default for Enigo {
Self {
is_x11,
tfc: if is_x11 {
Some(TFC_Context::new().expect("kbd context error"))
match TFC_Context::new() {
Ok(ctx) => Some(ctx),
Err(..) => {
println!("kbd context error");
None
}
}
} else {
None
},