aboutsummaryrefslogtreecommitdiff
path: root/jobs/requestdata.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-01-30 15:44:48 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-01-30 16:06:23 +0900
commit89a9656025e938a24a2ce8949e7aaf1aacaae37b (patch)
tree2d9cfc031cc2463092f764f89424fc6dcc47066a /jobs/requestdata.cpp
parent56d997607c21d52d0ce75067601814e5106a8ef0 (diff)
downloadlibquotient-89a9656025e938a24a2ce8949e7aaf1aacaae37b.tar.gz
libquotient-89a9656025e938a24a2ce8949e7aaf1aacaae37b.zip
RequestData: use auto
Should improve compatibility with compilers that don't like conversions between different std::unique_ptr<> types.
Diffstat (limited to 'jobs/requestdata.cpp')
-rw-r--r--jobs/requestdata.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/jobs/requestdata.cpp b/jobs/requestdata.cpp
index f5516c5f..5cb62221 100644
--- a/jobs/requestdata.cpp
+++ b/jobs/requestdata.cpp
@@ -8,7 +8,7 @@
using namespace QMatrixClient;
-std::unique_ptr<QIODevice> fromData(const QByteArray& data)
+auto fromData(const QByteArray& data)
{
auto source = std::make_unique<QBuffer>();
source->open(QIODevice::WriteOnly);
@@ -18,7 +18,7 @@ std::unique_ptr<QIODevice> fromData(const QByteArray& data)
}
template <typename JsonDataT>
-inline std::unique_ptr<QIODevice> fromJson(const JsonDataT& jdata)
+inline auto fromJson(const JsonDataT& jdata)
{
return fromData(QJsonDocument(jdata).toJson(QJsonDocument::Compact));
}