summaryrefslogtreecommitdiff
path: root/src/storage
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2020-03-11 23:43:06 -0700
committerRosen Penev <rosenp@gmail.com>2020-03-12 12:59:16 -0700
commitf00f8b002ae3a1b716eec30368aecf2438870d64 (patch)
tree4878729e5e33c7d0f0d5b2cafc9a08e57dde6878 /src/storage
parent2229e866730646cbc8334c598d3b6651ade4cf3e (diff)
[clang-tidy] use nodiscard
Introduced in C++17. It replaces gcc's warn_unused_result. Found with modernize-use-nodiscard. Signed-off-by: Rosen Penev <rosenp@gmail.com>
Diffstat (limited to 'src/storage')
-rw-r--r--src/storage/plugins/CurlStorage.cxx2
-rw-r--r--src/storage/plugins/NfsStorage.cxx4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/storage/plugins/CurlStorage.cxx b/src/storage/plugins/CurlStorage.cxx
index 4c44d3faa..a45f7369b 100644
--- a/src/storage/plugins/CurlStorage.cxx
+++ b/src/storage/plugins/CurlStorage.cxx
@@ -169,7 +169,7 @@ struct DavResponse {
std::chrono::system_clock::time_point::min();
uint64_t length = 0;
- bool Check() const {
+ [[nodiscard]] bool Check() const {
return !href.empty();
}
};
diff --git a/src/storage/plugins/NfsStorage.cxx b/src/storage/plugins/NfsStorage.cxx
index c7cdbfdba..c1c88c069 100644
--- a/src/storage/plugins/NfsStorage.cxx
+++ b/src/storage/plugins/NfsStorage.cxx
@@ -129,7 +129,7 @@ public:
}
private:
- EventLoop &GetEventLoop() const noexcept {
+ [[nodiscard]] EventLoop &GetEventLoop() const noexcept {
return defer_connect.GetEventLoop();
}
@@ -276,7 +276,7 @@ public:
:BlockingNfsOperation(_connection), path(_path),
follow(_follow) {}
- const StorageFileInfo &GetInfo() const {
+ [[nodiscard]] const StorageFileInfo &GetInfo() const {
return info;
}