Skip to content

Commit 3a9f458

Browse files
Fix issues found by clang-tidy
1 parent d284be0 commit 3a9f458

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/Connection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ sd_bus_message* Connection::createErrorReplyMessage(sd_bus_message* sdbusMsg, co
742742
Connection::BusPtr Connection::openBus(BusFactory&& busFactory)
743743
{
744744
sd_bus* bus{};
745-
const int r = busFactory(&bus);
745+
const int r = std::move(busFactory)(&bus);
746746
SDBUS_THROW_ERROR_IF(r < 0, "Failed to open bus", -r);
747747

748748
BusPtr busPtr{bus, [this](sd_bus* bus){ return sdbus_->sd_bus_flush_close_unref(bus); }};

src/Connection.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,11 @@ namespace sdbus::internal {
181181
sd_bus_message* createErrorReplyMessage(sd_bus_message* sdbusMsg, const Error& error) override;
182182

183183
private:
184-
using BusFactory = std::move_only_function<int(sd_bus**)>;
184+
using BusFactory = std::move_only_function<int(sd_bus**) &&>;
185185
using BusPtr = std::unique_ptr<sd_bus, std::move_only_function<sd_bus*(sd_bus*)>>;
186186
Connection(std::unique_ptr<ISdBus>&& interface, BusFactory&& busFactory);
187187

188-
BusPtr openBus(std::move_only_function<int(sd_bus**)>&& busFactory);
188+
BusPtr openBus(BusFactory&& busFactory);
189189
BusPtr openPseudoBus();
190190
void finishHandshake(sd_bus* bus);
191191
bool waitForNextEvent();
@@ -233,8 +233,8 @@ namespace sdbus::internal {
233233

234234
struct MatchInfo
235235
{
236-
message_handler&& callback;
237-
match_install_handler&& installCallback;
236+
message_handler callback;
237+
match_install_handler installCallback;
238238
Connection& connection; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
239239
Slot slot;
240240
};

0 commit comments

Comments
 (0)