[ox] Make Result copyTo and moveTo take refs

This commit is contained in:
2023-12-14 22:26:17 -06:00
parent 935099f8d4
commit d31938ba4f
5 changed files with 27 additions and 11 deletions

View File

@@ -265,7 +265,7 @@ Error OrganicClawReader::fieldCString(const char *key, char **val, std::size_t b
Error OrganicClawReader::field(const char *key, UUID *val) noexcept {
UUIDStr str;
oxReturnError(field(key, &str));
return UUID::fromString(str).moveTo(val);
return UUID::fromString(str).moveTo(*val);
}
Result<std::size_t> OrganicClawReader::arrayLength(const char *key, bool) noexcept {

View File

@@ -205,7 +205,7 @@ const std::map<ox::StringView, ox::Error(*)()> tests = {
testIn.Struct.String = "Test String 2";
testIn.unionIdx = 1;
testIn.Union.Int = 93;
oxAssert(ox::writeOC(testIn).moveTo(&dataBuff), "Data generation failed");
oxAssert(ox::writeOC(testIn).moveTo(dataBuff), "Data generation failed");
ox::TypeStore typeStore;
auto type = ox::buildTypeDef(&typeStore, &testIn);
oxAssert(type.error, "Descriptor write failed");