Skip to content

Commit

Permalink
add no-discard where applicable
Browse files Browse the repository at this point in the history
  • Loading branch information
forgottosave committed Nov 30, 2024
1 parent 61fecaa commit 86c0bb1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/util/cpplibostree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ class OSTreeRepo {
OstreeRepo* _c();

/// Getter
const std::string& GetRepoPath() const;
[[nodiscard]] const std::string& GetRepoPath() const;
/// Getter
const CommitList& GetCommitList() const;
[[nodiscard]] const CommitList& GetCommitList() const;
/// Getter
const std::vector<std::string>& GetBranches() const;
[[nodiscard]] const std::vector<std::string>& GetBranches() const;

// Methods

Expand All @@ -115,7 +115,7 @@ class OSTreeRepo {
* @return true if the commit is signed
* @return false if the commit is not signed
*/
static bool IsCommitSigned(const Commit& commit);
[[nodiscard]] static bool IsCommitSigned(const Commit& commit);

// read & write access to OSTree repo:

Expand Down Expand Up @@ -166,23 +166,23 @@ class OSTreeRepo {
* @param branch Branch to get most recent commit from.
* @return Most recent commit of the specified branch.
*/
const Commit& GetMostRecentCommitOfBranch(const std::string& branch) const;
[[nodiscard]] const Commit& GetMostRecentCommitOfBranch(const std::string& branch) const;

/**
* @brief Checks if commit is the most recent commit on its branch
*
* @param commit Commit to check.
* @return True, if commit is most recent on its branch.
*/
bool IsMostRecentCommitOnBranch(const Commit& commit) const;
[[nodiscard]] bool IsMostRecentCommitOnBranch(const Commit& commit) const;

/**
* @brief Checks if commit is the most recent commit on its branch
*
* @param hash Hash of the commit to check.
* @return True, if commit is most recent on its branch.
*/
bool IsMostRecentCommitOnBranch(const std::string& hash) const;
[[nodiscard]] bool IsMostRecentCommitOnBranch(const std::string& hash) const;

private:
/**
Expand Down Expand Up @@ -217,7 +217,7 @@ class OSTreeRepo {
*
* @return std::string All branch names, separated by spaces
*/
std::string getBranchesAsString();
[[nodiscard]] std::string getBranchesAsString();

/**
* @brief Parse a libostree GVariant commit to a C++ commit struct.
Expand Down

0 comments on commit 86c0bb1

Please sign in to comment.