Skip to content

Commit 1214ebb

Browse files
committed
a few more moves
1 parent 7821fc3 commit 1214ebb

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

include/rift/config.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,23 +117,23 @@ namespace rift {
117117
// Unwrap the arguments with deduced types
118118
auto res = unwrapArgs<Args...>(args);
119119
if (res.isErr()) {
120-
return geode::Err(res.unwrapErr());
120+
return geode::Err(std::move(res).unwrapErr());
121121
}
122122

123123
// Apply the unwrapped arguments to the lambda function
124124
if constexpr (std::same_as<Ret, void>) {
125-
std::apply(func, res.unwrap());
125+
std::apply(func, std::move(res).unwrap());
126126
return geode::Ok(Value());
127127
} else {
128-
Ret ret = std::apply(func, std::move(res.unwrap()));
128+
Ret ret = std::apply(func, std::move(res).unwrap());
129129

130130
// Convert the result to the correct type
131131
if constexpr (std::same_as<Ret, RuntimeFuncResult>) {
132132
return ret; // Already a Result
133133
} else if constexpr (std::same_as<Ret, Value>) {
134134
return geode::Ok(std::move(ret)); // Forwards the Value
135135
} else {
136-
return geode::Ok(Value(ret)); // Convert to Value
136+
return geode::Ok(Value(std::move(ret))); // Convert to Value
137137
}
138138
}
139139
};

src/config.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ namespace rift {
3737
return geode::Ok(static_cast<int64_t>(arg.getString().size()));
3838
}
3939

40-
return geode::Ok(static_cast<int64_t>(arg.toString().size()));
40+
41+
return geode::Ok(static_cast<int64_t>(fmt::formatted_size("{}", arg)));
4142
}
4243

4344
std::string toUpper(std::string&& str) noexcept {

src/value.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ namespace rift {
262262
auto const& value = other.toString();
263263

264264
if (value.empty()) {
265-
return geode::Ok(Value(str));
265+
return geode::Ok(Value(std::move(str)));
266266
}
267267

268268
size_t pos = 0;

0 commit comments

Comments
 (0)