mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 14:27:34 +00:00
AK+Userland: Make AK::decode_hex() return ErrorOr
This lets us propagate the reason why it failed up to the caller. :^)
This commit is contained in:
parent
45cf40653a
commit
f590cd1850
6 changed files with 31 additions and 33 deletions
4
AK/Hex.h
4
AK/Hex.h
|
@ -7,7 +7,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/ByteBuffer.h>
|
||||
#include <AK/Optional.h>
|
||||
#include <AK/Error.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/StringView.h>
|
||||
|
||||
|
@ -24,7 +24,7 @@ constexpr u8 decode_hex_digit(char digit)
|
|||
return 255;
|
||||
}
|
||||
|
||||
Optional<ByteBuffer> decode_hex(StringView);
|
||||
ErrorOr<ByteBuffer> decode_hex(StringView);
|
||||
|
||||
String encode_hex(ReadonlyBytes);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue