1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 22:48:11 +00:00

LibKeyboard: Change some Optional<T> returns to ErrorOr<T>

Makes CharacterMapFile::load_from_file and CharacterMap::load_from_file
return ErrorOr instead of Optional. This makes them a little nicer to
use and a little easier to read, as they seem to have been approximating
this.
This commit is contained in:
RasmusNylander 2021-12-16 17:46:49 +01:00 committed by Andreas Kling
parent 017135b44e
commit 4e65c4dae4
5 changed files with 10 additions and 22 deletions

View file

@ -14,7 +14,7 @@ namespace Keyboard {
class CharacterMapFile {
public:
static Optional<CharacterMapData> load_from_file(const String& filename);
static ErrorOr<CharacterMapData> load_from_file(const String& filename);
private:
static Vector<u32> read_map(const JsonObject& json, const String& name);