[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>
This commit is contained in:
@@ -61,7 +61,7 @@ public:
|
||||
LibmpdclientError(enum mpd_error _code, const char *_msg)
|
||||
:std::runtime_error(_msg), code(_code) {}
|
||||
|
||||
enum mpd_error GetCode() const {
|
||||
[[nodiscard]] enum mpd_error GetCode() const {
|
||||
return code;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -95,12 +95,12 @@ public:
|
||||
VisitSong visit_song,
|
||||
VisitPlaylist visit_playlist) const override;
|
||||
|
||||
RecursiveMap<std::string> CollectUniqueTags(const DatabaseSelection &selection,
|
||||
[[nodiscard]] RecursiveMap<std::string> CollectUniqueTags(const DatabaseSelection &selection,
|
||||
ConstBuffer<TagType> tag_types) const override;
|
||||
|
||||
DatabaseStats GetStats(const DatabaseSelection &selection) const override;
|
||||
[[nodiscard]] DatabaseStats GetStats(const DatabaseSelection &selection) const override;
|
||||
|
||||
std::chrono::system_clock::time_point GetUpdateStamp() const noexcept override {
|
||||
[[nodiscard]] std::chrono::system_clock::time_point GetUpdateStamp() const noexcept override {
|
||||
return std::chrono::system_clock::time_point::min();
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ private:
|
||||
* except easier cause our inodes have a parent id. Not used
|
||||
* any more actually (see comments in SearchSongs).
|
||||
*/
|
||||
std::string BuildPath(const ContentDirectoryService &server,
|
||||
[[nodiscard]] std::string BuildPath(const ContentDirectoryService &server,
|
||||
const UPnPDirObject& dirent) const;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user