use sdbusplus unpack syntax
Rather than defining a variable and then reading it from a message,
sdbusplus also supports directly unpack-ing from the message. Use
this syntax instead as it is more efficient and succinct.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I6cfa8f7341cc0df7d48b90c83b9f25985d668cab
diff --git a/subprojects/metrics-ipmi-blobs/util.cpp b/subprojects/metrics-ipmi-blobs/util.cpp
index 79d97db..1c54e83 100644
--- a/subprojects/metrics-ipmi-blobs/util.cpp
+++ b/subprojects/metrics-ipmi-blobs/util.cpp
@@ -296,8 +296,8 @@
"org.freedesktop.DBus.Properties", "GetAll");
m.append("");
auto reply = b.call(m);
- std::vector<std::pair<std::string, std::variant<uint64_t>>> timestamps;
- reply.read(timestamps);
+ auto timestamps = reply.unpack<
+ std::vector<std::pair<std::string, std::variant<uint64_t>>>>();
// Parse timestamps from dbus result.
auto btmPtr = reinterpret_cast<char*>(&btm);
diff --git a/subprojects/nemora-postd/src/nemora.cpp b/subprojects/nemora-postd/src/nemora.cpp
index d051241..95d6bb1 100644
--- a/subprojects/nemora-postd/src/nemora.cpp
+++ b/subprojects/nemora-postd/src/nemora.cpp
@@ -71,8 +71,8 @@
return false;
}
- std::variant<std::string> result;
- reply.read(result);
+ auto result = reply.unpack<std::variant<std::string>>();
+
auto mac_addr = std::get<std::string>(result);
if (!ParseMac(mac_addr, mac))
{