Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
debug_assert
Browse files Browse the repository at this point in the history
  • Loading branch information
ruihe774 committed Dec 21, 2023
1 parent ce0acad commit 6e534a3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src-tauri/monitor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,13 @@ fn get_monitors_gdi(monitors: &mut Vec<Monitor>, monitor_ids: &mut BTreeMap<OsSt
.read(true)
.write(true)
.open(&id)
.map_or(HANDLE(-1), |f| HANDLE(f.into_raw_handle() as isize));
.map_or_else(
|e| {
debug_assert!(false, "failed to open device file handle: {e:?}");
HANDLE(-1)
},
|f| HANDLE(f.into_raw_handle() as isize),
);
monitors.push(Monitor {
id,
hphysical,
Expand Down

0 comments on commit 6e534a3

Please sign in to comment.