[keel] Remove use of removed ModelValue operator
All checks were successful
Build / build (push) Successful in 2m24s

This commit is contained in:
Gary Talent 2024-02-11 20:35:48 -06:00
parent 74fb051ef2
commit db2dc28f92

View File

@ -14,15 +14,15 @@ namespace keel {
static ox::Error pathToInode( static ox::Error pathToInode(
keel::Context &ctx, ox::FileSystem &dest, ox::ModelObject &obj) noexcept { keel::Context &ctx, ox::FileSystem &dest, ox::ModelObject &obj) noexcept {
auto &o = obj; auto &o = obj;
auto type = static_cast<ox::FileAddressType>(o["type"].get<int8_t>()); auto type = static_cast<ox::FileAddressType>(o.at("type").unwrap()->get<int8_t>());
auto &data = o["data"].get<ox::ModelUnion>(); auto &data = o.at("data").unwrap()->get<ox::ModelUnion>();
ox::String path; ox::String path;
switch (type) { switch (type) {
case ox::FileAddressType::Path: case ox::FileAddressType::Path:
path = data["path"].get<ox::String>(); path = data.at("path").unwrap()->get<ox::String>();
break; break;
case ox::FileAddressType::ConstPath: case ox::FileAddressType::ConstPath:
path = data["constPath"].get<ox::String>(); path = data.at("constPath").unwrap()->get<ox::String>();
break; break;
case ox::FileAddressType::Inode: case ox::FileAddressType::Inode:
case ox::FileAddressType::None: case ox::FileAddressType::None:
@ -33,7 +33,7 @@ static ox::Error pathToInode(
oxReturnError(keel::uuidToPath(ctx, uuid).moveTo(path)); oxReturnError(keel::uuidToPath(ctx, uuid).moveTo(path));
} }
oxRequire(s, dest.stat(path)); oxRequire(s, dest.stat(path));
oxReturnError(o["type"].set(static_cast<int8_t>(ox::FileAddressType::Inode))); oxReturnError(o.at("type").unwrap()->set(static_cast<int8_t>(ox::FileAddressType::Inode)));
oxOutf("path to inode: {} => {}\n", path, s.inode); oxOutf("path to inode: {} => {}\n", path, s.inode);
return data.set(2, s.inode); return data.set(2, s.inode);
} }