Skip to content

Commit 8c85f17

Browse files
committed
fix(failure): use const& for fail_with message/domain
1 parent d7364c0 commit 8c85f17

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/failure.hpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,10 @@ inline Unexpected fail_with(
156156
const std::string& domain = {},
157157
const std::source_location loc = std::source_location::current()
158158
) {
159+
// TODO: message/domain are copied from const&
160+
// revisit if string_view or forwarding becomes viable
159161
return Unexpected {Failure {
160-
ErrorInfo {
161-
.message = std::move(message),
162-
.domain = std::move(domain),
163-
.payload = std::move(payload)
164-
},
162+
ErrorInfo {.message = message, .domain = domain, .payload = std::move(payload)},
165163
Frame::current(loc)
166164
}};
167165
}

0 commit comments

Comments
 (0)