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: Id36cca2ca362f505ed9f70d30f6665a8c1a62722
diff --git a/utils.cpp b/utils.cpp
index 4025f94..bc299cb 100644
--- a/utils.cpp
+++ b/utils.cpp
@@ -192,9 +192,7 @@
auto reply = bus.call(method);
- std::variant<std::string> propertyVal;
-
- reply.read(propertyVal);
+ auto propertyVal = reply.unpack<std::variant<std::string>>();
stateVal = std::get<std::string>(propertyVal);
}