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:
Rosen Penev
2020-11-05 17:11:33 -08:00
parent afbcac9fb1
commit 071d3c71d8
3 changed files with 17 additions and 20 deletions

View File

@@ -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));
});
}
}