mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-14 15:13:07 +00:00
Kernel/Net: Make the LoopbackAdapter initializer to use ErrorOr pattern
This looks much more nice, and also matches our pattern for other types of network adapters' initializers.
This commit is contained in:
parent
9f011592be
commit
bd7d4513bf
Notes:
sideshowbarker
2024-07-17 20:19:08 +09:00
Author: https://github.com/supercomputer7
Commit: bd7d4513bf
Pull-request: https://github.com/SerenityOS/serenity/pull/18282
3 changed files with 6 additions and 9 deletions
|
@ -136,10 +136,9 @@ bool NetworkingManagement::initialize()
|
|||
m_adapters.with([&](auto& adapters) { adapters.append(*result.release_value()); });
|
||||
}));
|
||||
}
|
||||
auto loopback = LoopbackAdapter::try_create();
|
||||
VERIFY(loopback);
|
||||
auto loopback = MUST(LoopbackAdapter::try_create());
|
||||
m_adapters.with([&](auto& adapters) { adapters.append(*loopback); });
|
||||
m_loopback_adapter = loopback;
|
||||
m_loopback_adapter = *loopback;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue