[ox] Cleanup some const_casts

This commit is contained in:
Gary Talent 2023-12-09 00:49:03 -06:00
parent 40a3c28fbf
commit cd0958c691
2 changed files with 3 additions and 3 deletions

View File

@ -301,7 +301,7 @@ constexpr Error MetalClawWriter<Writer>::field(const char*, const T *val, std::s
oxReturnError(handler.template setTypeInfo<T>("List", 0, {}, static_cast<std::size_t>(len)));
// write the array
for (std::size_t i = 0; i < len; i++) {
oxReturnError(handler.field("", const_cast<const T*>(&val[i])));
oxReturnError(handler.field("", &val[i]));
}
oxReturnError(writer.finalize());
fieldSet = true;

View File

@ -144,10 +144,10 @@ struct [[nodiscard]] Result {
constexpr Result(const Error &error) noexcept: value(), error(error) {
}
constexpr Result(const type &value, const Error &error = OxError(0)) noexcept: value(const_cast<type&>(value)), error(error) {
constexpr Result(const type &value, const Error &error = OxError(0)) noexcept: value(value), error(error) {
}
constexpr Result(type &&value, const Error &error = OxError(0)) noexcept: value(ox::forward<type>(value)), error(error) {
constexpr Result(type &&value, const Error &error = OxError(0)) noexcept: value(std::move(value)), error(error) {
}
constexpr ~Result() noexcept = default;