AK: Implement missing const getters in AK::Error, fix typo

Note that the return type for the non-const method error() changed. This
is most likely an accident, hidden by the fact that ErrorType typically
is Error.
This commit is contained in:
Ben Wiederhake 2021-11-26 22:38:40 +01:00 committed by Andreas Kling
parent dbd60f9ff4
commit 6f37510a71

View file

@ -93,7 +93,9 @@ public:
ErrorOr& operator=(ErrorOr const& other) = default;
T& value() { return m_value.value(); }
Error& error() { return m_error.value(); }
T const& value() const { return m_value.value(); }
ErrorType& error() { return m_error.value(); }
ErrorType const& error() const { return m_error.value(); }
bool is_error() const { return m_error.has_value(); }