diff options
author | Brian Gianforcaro <b.gianfo@gmail.com> | 2021-04-11 02:31:30 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-04-11 12:50:33 +0200 |
commit | 7db74a6b3e9819f79333adf353ffc358613045ce (patch) | |
tree | 071f635d12350c2f112643e9071e7ec8d79656df /AK | |
parent | 23454cab467c7ab83ee4f4cc9e19fd528cf64677 (diff) | |
download | serenity-7db74a6b3e9819f79333adf353ffc358613045ce.zip |
AK: Annotate StringBuilder functions as [[nodiscard]]
Diffstat (limited to 'AK')
-rw-r--r-- | AK/StringBuilder.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/AK/StringBuilder.h b/AK/StringBuilder.h index e578ca885b..cb70dd67d5 100644 --- a/AK/StringBuilder.h +++ b/AK/StringBuilder.h @@ -57,15 +57,15 @@ public: vformat(*this, fmtstr.view(), VariadicFormatParams { parameters... }); } - String build() const; - String to_string() const; - ByteBuffer to_byte_buffer() const; + [[nodiscard]] String build() const; + [[nodiscard]] String to_string() const; + [[nodiscard]] ByteBuffer to_byte_buffer() const; - StringView string_view() const; + [[nodiscard]] StringView string_view() const; void clear(); - size_t length() const { return m_length; } - bool is_empty() const { return m_length == 0; } + [[nodiscard]] size_t length() const { return m_length; } + [[nodiscard]] bool is_empty() const { return m_length == 0; } void trim(size_t count) { m_length -= count; } template<class SeparatorType, class CollectionType> |