1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-02 23:22:07 +00:00

AK: Use an enum to specify the open mode instead of a bool

Let's replace this bool with an `enum class` in order to enhance
readability. This is done by repurposing `MappedFile`'s `OpenMode` into
a shared `enum` simply called `Mode`.
This commit is contained in:
Lucas CHOLLET 2023-11-05 15:31:17 -05:00 committed by Tim Schumacher
parent 00ad8419cf
commit b00476abac
7 changed files with 24 additions and 25 deletions

View file

@ -44,7 +44,7 @@ static constexpr LoaderPluginInitializer s_initializers[] = {
ErrorOr<NonnullRefPtr<Loader>, LoaderError> Loader::create(StringView path)
{
auto stream = TRY(Core::MappedFile::map(path, Core::MappedFile::OpenMode::ReadOnly));
auto stream = TRY(Core::MappedFile::map(path, Core::MappedFile::Mode::ReadOnly));
return adopt_ref(*new (nothrow) Loader(TRY(Loader::create_plugin(move(stream)))));
}