-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
media/media_codec: Replace
construct_never_null
and infallible `unw…
…rap()` pattern with something more sensible (#248) These functions return a pointer directly instead of an error code with the pointer as argument, making them unsuitable for use with `construct_never_null`. Because there is no error code, returning a manual success value still requires an infallible `unwrap()` call to unpack the `Result`. Replace this with a new helper function that does not unnecessarily wrap the resulting pointer in a `Result` when there is no result code to base this off, and match the signature to a function that returns the pointer directly. At the same time reduce the size of some `unsafe {}` blocks to wrap just what is unsafe.
- Loading branch information
Showing
2 changed files
with
27 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters