diff options
Diffstat (limited to 'Userland/Libraries/LibGfx/Rect.cpp')
-rw-r--r-- | Userland/Libraries/LibGfx/Rect.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Userland/Libraries/LibGfx/Rect.cpp b/Userland/Libraries/LibGfx/Rect.cpp index 8fe8c1baeb..34ddd4f709 100644 --- a/Userland/Libraries/LibGfx/Rect.cpp +++ b/Userland/Libraries/LibGfx/Rect.cpp @@ -328,16 +328,14 @@ bool encode(Encoder& encoder, Gfx::IntRect const& rect) return true; } -bool decode(Decoder& decoder, Gfx::IntRect& rect) +ErrorOr<void> decode(Decoder& decoder, Gfx::IntRect& rect) { Gfx::IntPoint point; Gfx::IntSize size; - if (!decoder.decode(point)) - return false; - if (!decoder.decode(size)) - return false; + TRY(decoder.decode(point)); + TRY(decoder.decode(size)); rect = { point, size }; - return true; + return {}; } } |