From 3c145c0f4989a83a8264f66c311d1b183a21590b Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 21 Apr 2020 15:45:05 -0700 Subject: [PATCH] [clang-tidy] add nodiscard Found with modernize-use-nodiscard Signed-off-by: Rosen Penev --- src/db/plugins/upnp/UpnpDatabasePlugin.cxx | 2 +- src/storage/plugins/CurlStorage.cxx | 4 ++-- src/storage/plugins/LocalStorage.cxx | 8 ++++---- src/storage/plugins/NfsStorage.cxx | 4 ++-- src/storage/plugins/SmbclientStorage.cxx | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/db/plugins/upnp/UpnpDatabasePlugin.cxx b/src/db/plugins/upnp/UpnpDatabasePlugin.cxx index 1fa54dad3..0c9dc3ed8 100644 --- a/src/db/plugins/upnp/UpnpDatabasePlugin.cxx +++ b/src/db/plugins/upnp/UpnpDatabasePlugin.cxx @@ -88,7 +88,7 @@ public: void Open() override; void Close() noexcept override; - const LightSong *GetSong(std::string_view uri_utf8) const override; + [[nodiscard]] const LightSong *GetSong(std::string_view uri_utf8) const override; void ReturnSong(const LightSong *song) const noexcept override; void Visit(const DatabaseSelection &selection, diff --git a/src/storage/plugins/CurlStorage.cxx b/src/storage/plugins/CurlStorage.cxx index 6d0bba16d..d2fc24150 100644 --- a/src/storage/plugins/CurlStorage.cxx +++ b/src/storage/plugins/CurlStorage.cxx @@ -61,9 +61,9 @@ public: std::unique_ptr OpenDirectory(std::string_view uri_utf8) override; - std::string MapUTF8(std::string_view uri_utf8) const noexcept override; + [[nodiscard]] std::string MapUTF8(std::string_view uri_utf8) const noexcept override; - std::string_view MapToRelativeUTF8(std::string_view uri_utf8) const noexcept override; + [[nodiscard]] std::string_view MapToRelativeUTF8(std::string_view uri_utf8) const noexcept override; }; std::string diff --git a/src/storage/plugins/LocalStorage.cxx b/src/storage/plugins/LocalStorage.cxx index b25a5b035..46673e3cf 100644 --- a/src/storage/plugins/LocalStorage.cxx +++ b/src/storage/plugins/LocalStorage.cxx @@ -60,14 +60,14 @@ public: std::unique_ptr OpenDirectory(std::string_view uri_utf8) override; - std::string MapUTF8(std::string_view uri_utf8) const noexcept override; + [[nodiscard]] std::string MapUTF8(std::string_view uri_utf8) const noexcept override; - AllocatedPath MapFS(std::string_view uri_utf8) const noexcept override; + [[nodiscard]] AllocatedPath MapFS(std::string_view uri_utf8) const noexcept override; - std::string_view MapToRelativeUTF8(std::string_view uri_utf8) const noexcept override; + [[nodiscard]] std::string_view MapToRelativeUTF8(std::string_view uri_utf8) const noexcept override; private: - AllocatedPath MapFSOrThrow(std::string_view uri_utf8) const; + [[nodiscard]] AllocatedPath MapFSOrThrow(std::string_view uri_utf8) const; }; static StorageFileInfo diff --git a/src/storage/plugins/NfsStorage.cxx b/src/storage/plugins/NfsStorage.cxx index 3b8d9f9ea..5c44591fc 100644 --- a/src/storage/plugins/NfsStorage.cxx +++ b/src/storage/plugins/NfsStorage.cxx @@ -90,9 +90,9 @@ public: std::unique_ptr OpenDirectory(std::string_view uri_utf8) override; - std::string MapUTF8(std::string_view uri_utf8) const noexcept override; + [[nodiscard]] std::string MapUTF8(std::string_view uri_utf8) const noexcept override; - std::string_view MapToRelativeUTF8(std::string_view uri_utf8) const noexcept override; + [[nodiscard]] std::string_view MapToRelativeUTF8(std::string_view uri_utf8) const noexcept override; /* virtual methods from NfsLease */ void OnNfsConnectionReady() noexcept final { diff --git a/src/storage/plugins/SmbclientStorage.cxx b/src/storage/plugins/SmbclientStorage.cxx index 899640784..c227978c4 100644 --- a/src/storage/plugins/SmbclientStorage.cxx +++ b/src/storage/plugins/SmbclientStorage.cxx @@ -68,9 +68,9 @@ public: std::unique_ptr OpenDirectory(std::string_view uri_utf8) override; - std::string MapUTF8(std::string_view uri_utf8) const noexcept override; + [[nodiscard]] std::string MapUTF8(std::string_view uri_utf8) const noexcept override; - std::string_view MapToRelativeUTF8(std::string_view uri_utf8) const noexcept override; + [[nodiscard]] std::string_view MapToRelativeUTF8(std::string_view uri_utf8) const noexcept override; }; std::string