-
-
Notifications
You must be signed in to change notification settings - Fork 46
Closed
Description
Libwayshot currently has certain instances of unwrap() and I think replacing it to Result is good for the stability of library and they can cause host application to panic at runtime.
I am proposing to replace all the instances of unwrap() to Result with proper error msgs.
I have analyzed and found the following instances:
src/lib.rs: bo.fd_for_plane(0).unwrap(),
src/dispatch.rs: let format = state.formats.first_mut().unwrap();
src/dispatch.rs: let set_format = state.formats.first_mut().unwrap();
src/dispatch.rs: let device = u64::from_le_bytes(device.try_into().unwrap());
src/dispatch.rs: Card(options.open(path).unwrap())
Proposed Implementation:
Convert affected functions to return Result<T, Error> with proper error messages indicating the failure reason.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels