mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-22 02:52:52 +00:00
Kernel/Storage: Migrate the partition code to use the ErrorOr container
That code used the old AK::Result container, which leads to overly complicated initialization flow when trying to figure out the correct partition table type. Instead, when using the ErrorOr container the code is much simpler and more understandable.
This commit is contained in:
parent
19912a0b32
commit
5ed3f7c6bf
Notes:
sideshowbarker
2024-07-17 11:29:39 +09:00
Author: https://github.com/supercomputer7
Commit: 5ed3f7c6bf
Pull-request: https://github.com/SerenityOS/serenity/pull/13796
Reviewed-by: https://github.com/linusg
9 changed files with 39 additions and 50 deletions
|
@ -1,11 +1,12 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Liav A. <liavalb@hotmail.co.il>
|
||||
* Copyright (c) 2020-2022, Liav A. <liavalb@hotmail.co.il>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Error.h>
|
||||
#include <AK/RefPtr.h>
|
||||
#include <AK/Result.h>
|
||||
#include <AK/Types.h>
|
||||
|
@ -20,7 +21,7 @@ public:
|
|||
virtual ~GUIDPartitionTable() = default;
|
||||
;
|
||||
|
||||
static Result<NonnullOwnPtr<GUIDPartitionTable>, PartitionTable::Error> try_to_initialize(StorageDevice const&);
|
||||
static ErrorOr<NonnullOwnPtr<GUIDPartitionTable>> try_to_initialize(StorageDevice const&);
|
||||
explicit GUIDPartitionTable(StorageDevice const&);
|
||||
|
||||
virtual bool is_valid() const override { return m_valid; };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue