mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 15:45:25 +00:00
Kernel: Stop using the make<T> factory method in the Kernel
As make<T> is infallible, it really should not be used anywhere in the Kernel. Instead replace with fallible `new (nothrow)` calls, that will eventually be error-propagated.
This commit is contained in:
committed by
Andreas Kling
parent
e5e7cb822a
commit
8289727fac
@@ -49,7 +49,7 @@ struct [[gnu::packed]] GUIDPartitionHeader {
|
||||
|
||||
Result<NonnullOwnPtr<GUIDPartitionTable>, PartitionTable::Error> GUIDPartitionTable::try_to_initialize(const StorageDevice& device)
|
||||
{
|
||||
auto table = make<GUIDPartitionTable>(device);
|
||||
auto table = adopt_nonnull_own_or_enomem(new (nothrow) GUIDPartitionTable(device)).release_value_but_fixme_should_propagate_errors();
|
||||
if (!table->is_valid())
|
||||
return { PartitionTable::Error::Invalid };
|
||||
return table;
|
||||
|
||||
Reference in New Issue
Block a user