mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-11-18 03:02:07 +00:00
chore: pass ZoneLoading error as result
This commit is contained in:
@@ -2,11 +2,11 @@
|
||||
|
||||
#include "ZoneLoading.h"
|
||||
|
||||
std::optional<Zone*> FastFileContext::LoadFastFile(const std::string& path)
|
||||
result::Expected<Zone*, std::string> FastFileContext::LoadFastFile(const std::string& path)
|
||||
{
|
||||
auto zone = ZoneLoading::LoadZone(path);
|
||||
if (!zone)
|
||||
return std::nullopt;
|
||||
return result::Unexpected(std::move(zone.error()));
|
||||
|
||||
return m_loaded_zones.emplace_back(std::move(zone)).get();
|
||||
return m_loaded_zones.emplace_back(std::move(*zone)).get();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user