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:
Liav A 2023-04-11 03:44:55 +03:00 committed by Linus Groh
parent 9f011592be
commit bd7d4513bf
Notes: sideshowbarker 2024-07-17 20:19:08 +09:00
3 changed files with 6 additions and 9 deletions

View file

@ -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;
}
}