mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 11:47:46 +00:00
LibAudio: Stop using and remove LOADER_TRY
It's no longer needed now that this code uses ErrorOr instead of Result. Ran: rg -lw LOADER_TRY Userland/Libraries/LibAudio \ | xargs sed -i '' 's/LOADER_TRY/TRY/g' ...and then manually fixed up Userland/Libraries/LibAudio/LoaderError.h to not redefine TRY but instead remove the now-unused LOADER_TRY, and ran clang-format.
This commit is contained in:
parent
9594b79d38
commit
5619bb3e04
6 changed files with 166 additions and 177 deletions
|
@ -94,14 +94,3 @@ struct Formatter<Audio::LoaderError> : Formatter<FormatString> {
|
|||
};
|
||||
|
||||
}
|
||||
|
||||
// Convenience TRY-like macro to convert an Error to a LoaderError
|
||||
#define LOADER_TRY(expression) \
|
||||
({ \
|
||||
auto&& _temporary_result = (expression); \
|
||||
if (_temporary_result.is_error()) \
|
||||
return LoaderError(_temporary_result.release_error()); \
|
||||
static_assert(!::AK::Detail::IsLvalueReference<decltype(_temporary_result.release_value())>, \
|
||||
"Do not return a reference from a fallible expression"); \
|
||||
_temporary_result.release_value(); \
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue