[ox/std] Fix Result::moveTo to not move if error

(synced from f8f5b059ed)
This commit is contained in:
2022-07-24 01:22:40 -05:00
parent 5d00067da7
commit 7a792644d7
+3 -1
View File
@@ -174,7 +174,9 @@ struct [[nodiscard]] Result {
}
constexpr Error moveTo(type *val) noexcept {
*val = std::move(value);
if (!error) [[likely]] {
*val = std::move(value);
}
return error;
}