clang-tidy: replace std::bind with lambdas
Found with modernize-avoid-bind Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
@@ -120,19 +120,20 @@ static void
|
||||
ParseInterface(Object &o, const char *interface,
|
||||
ODBus::ReadMessageIter &&i) noexcept
|
||||
{
|
||||
using namespace std::placeholders;
|
||||
if (StringIsEqual(interface, "org.freedesktop.UDisks2.Drive")) {
|
||||
i.ForEachProperty(std::bind(ParseDriveDictEntry,
|
||||
std::ref(o), _1, _2));
|
||||
i.ForEachProperty([&](auto n, auto v) {
|
||||
return ParseDriveDictEntry(o, n, std::move(v));
|
||||
});
|
||||
} else if (StringIsEqual(interface, "org.freedesktop.UDisks2.Block")) {
|
||||
i.ForEachProperty(std::bind(ParseBlockDictEntry,
|
||||
std::ref(o), _1, _2));
|
||||
i.ForEachProperty([&](auto n, auto v) {
|
||||
return ParseBlockDictEntry(o, n, std::move(v));
|
||||
});
|
||||
} else if (StringIsEqual(interface, "org.freedesktop.UDisks2.Filesystem")) {
|
||||
o.is_filesystem = true;
|
||||
|
||||
i.ForEachProperty(std::bind(ParseFileesystemDictEntry,
|
||||
std::ref(o), _1, _2));
|
||||
|
||||
i.ForEachProperty([&](auto n, auto v) {
|
||||
return ParseFileesystemDictEntry(o, n, std::move(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user