Commit 989dac42 authored by Harald Sitter's avatar Harald Sitter 🏳️‍🌈
Browse files

clang-tidy: modernize-use-nodiscard

parent e3956369
......@@ -22,7 +22,7 @@ public:
Q_UNREACHABLE();
}
APIJob *get(const QString &path, const Query &query = Query()) const override
[[nodiscard]] APIJob *get(const QString &path, const Query &query = Query()) const override
{
Q_UNUSED(path)
Q_UNUSED(query)
......@@ -30,7 +30,7 @@ public:
return nullptr;
}
APIJob *post(const QString &path, const QByteArray &data, const Query &query = Query()) const override
[[nodiscard]] APIJob *post(const QString &path, const QByteArray &data, const Query &query = Query()) const override
{
Q_UNUSED(query);
if (path == "/bug/1/attachment") {
......@@ -43,7 +43,7 @@ public:
return nullptr;
}
APIJob *put(const QString &path, const QByteArray &, const Query &query = Query()) const override
[[nodiscard]] APIJob *put(const QString &path, const QByteArray &, const Query &query = Query()) const override
{
Q_UNUSED(path)
Q_UNUSED(query)
......
......@@ -22,7 +22,7 @@ public:
Q_UNREACHABLE();
}
APIJob *get(const QString &path, const Query &query = Query()) const override
[[nodiscard]] APIJob *get(const QString &path, const Query &query = Query()) const override
{
if (path == "/field/bug/rep_platform" && query.toString() == "") {
return new JobDouble{QFINDTESTDATA("data/field.rep_platform.json")};
......@@ -31,13 +31,13 @@ public:
return nullptr;
}
APIJob *post(const QString &path, const QByteArray &, const Query &query = Query()) const override
[[nodiscard]] APIJob *post(const QString &path, const QByteArray &, const Query &query = Query()) const override
{
Q_ASSERT_X(false, "post", qUtf8Printable(QStringLiteral("unmapped: %1; %2").arg(path, query.toString())));
return nullptr;
}
APIJob *put(const QString &path, const QByteArray &, const Query &query = Query()) const override
[[nodiscard]] APIJob *put(const QString &path, const QByteArray &, const Query &query = Query()) const override
{
Q_ASSERT_X(false, "put", qUtf8Printable(QStringLiteral("unmapped: %1; %2").arg(path, query.toString())));
return nullptr;
......
......@@ -49,7 +49,7 @@ public:
Q_UNREACHABLE();
}
APIJob *get(const QString &path, const Query &query = Query()) const override
[[nodiscard]] APIJob *get(const QString &path, const Query &query = Query()) const override
{
if (path == "/bug" && query.toString() == "product=dragonplayer") {
return new JobDouble{QFINDTESTDATA("data/bugs.dragonplayer.json")};
......@@ -61,7 +61,7 @@ public:
return nullptr;
}
APIJob *post(const QString &path, const QByteArray &data, const Query &query = Query()) const override
[[nodiscard]] APIJob *post(const QString &path, const QByteArray &data, const Query &query = Query()) const override
{
qDebug() << path << query.toString();
if (path == "/bug" && query.isEmpty()) {
......@@ -79,7 +79,7 @@ public:
return nullptr;
}
APIJob *put(const QString &path, const QByteArray &data, const Query &query = Query()) const override
[[nodiscard]] APIJob *put(const QString &path, const QByteArray &data, const Query &query = Query()) const override
{
if (path == "/bug/54321" && query.isEmpty()) {
QJsonParseError e;
......
......@@ -22,7 +22,7 @@ public:
Q_UNREACHABLE();
}
APIJob *get(const QString &path, const Query &query = Query()) const override
[[nodiscard]] APIJob *get(const QString &path, const Query &query = Query()) const override
{
if (path == "/version") {
return new JobDouble{QFINDTESTDATA("data/bugzilla.version.json")};
......@@ -33,13 +33,13 @@ public:
return nullptr;
}
APIJob *post(const QString &path, const QByteArray &, const Query &query = Query()) const override
[[nodiscard]] APIJob *post(const QString &path, const QByteArray &, const Query &query = Query()) const override
{
Q_ASSERT_X(false, "post", qUtf8Printable(QStringLiteral("unmapped: %1; %2").arg(path, query.toString())));
return nullptr;
}
APIJob *put(const QString &path, const QByteArray &, const Query &query = Query()) const override
[[nodiscard]] APIJob *put(const QString &path, const QByteArray &, const Query &query = Query()) const override
{
Q_ASSERT_X(false, "put", qUtf8Printable(QStringLiteral("unmapped: %1; %2").arg(path, query.toString())));
return nullptr;
......
......@@ -22,7 +22,7 @@ public:
Q_UNREACHABLE();
}
APIJob *get(const QString &path, const Query &query = Query()) const override
[[nodiscard]] APIJob *get(const QString &path, const Query &query = Query()) const override
{
if (path == "/bug/407363/comment" && query.toString().isEmpty()) {
return new JobDouble{QFINDTESTDATA("data/comments.json")};
......@@ -34,7 +34,7 @@ public:
return nullptr;
}
APIJob *post(const QString &path, const QByteArray &, const Query &query = Query()) const override
[[nodiscard]] APIJob *post(const QString &path, const QByteArray &, const Query &query = Query()) const override
{
Q_UNUSED(path);
Q_UNUSED(query);
......@@ -42,7 +42,7 @@ public:
return nullptr;
}
APIJob *put(const QString &path, const QByteArray &, const Query &query = Query()) const override
[[nodiscard]] APIJob *put(const QString &path, const QByteArray &, const Query &query = Query()) const override
{
Q_UNUSED(path);
Q_UNUSED(query);
......
......@@ -23,7 +23,7 @@ public:
Q_UNREACHABLE();
}
APIJob *get(const QString &path, const Query &query = Query()) const override
[[nodiscard]] APIJob *get(const QString &path, const Query &query = Query()) const override
{
Q_UNUSED(path);
Q_UNUSED(query);
......@@ -34,14 +34,14 @@ public:
return nullptr;
}
APIJob *post(const QString &path, const QByteArray &, const Query &query = Query()) const override
[[nodiscard]] APIJob *post(const QString &path, const QByteArray &, const Query &query = Query()) const override
{
qDebug() << path << query.toString();
Q_UNREACHABLE();
return nullptr;
}
APIJob *put(const QString &, const QByteArray &, const Query & = Query()) const override
[[nodiscard]] APIJob *put(const QString &, const QByteArray &, const Query & = Query()) const override
{
Q_UNREACHABLE();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment