1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:27:46 +00:00

Meta+Kernel: Make clang-format-10 clean

This commit is contained in:
Ben Wiederhake 2020-09-18 09:49:51 +02:00 committed by Andreas Kling
parent fa62c5595e
commit 64cc3f51d0
61 changed files with 123 additions and 118 deletions

View file

@ -35,7 +35,8 @@ enum KSuccessTag {
KSuccess
};
class [[nodiscard]] KResult {
class [[nodiscard]] KResult
{
public:
ALWAYS_INLINE explicit KResult(int negative_e)
: m_error(negative_e)
@ -61,7 +62,8 @@ private:
};
template<typename T>
class alignas(T) [[nodiscard]] KResultOr {
class alignas(T) [[nodiscard]] KResultOr
{
public:
KResultOr(KResult error)
: m_error(error)
@ -69,20 +71,29 @@ public:
{
}
// FIXME: clang-format gets confused about T. Why?
// clang-format off
ALWAYS_INLINE KResultOr(T&& value)
// clang-format on
{
new (&m_storage) T(move(value));
m_have_storage = true;
}
template<typename U>
// FIXME: clang-format gets confused about U. Why?
// clang-format off
ALWAYS_INLINE KResultOr(U&& value)
// clang-format on
{
new (&m_storage) T(move(value));
m_have_storage = true;
}
// FIXME: clang-format gets confused about KResultOr. Why?
// clang-format off
KResultOr(KResultOr&& other)
// clang-format on
{
m_is_error = other.m_is_error;
if (m_is_error)