From 7db74a6b3e9819f79333adf353ffc358613045ce Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Sun, 11 Apr 2021 02:31:30 -0700 Subject: [PATCH] AK: Annotate StringBuilder functions as [[nodiscard]] --- AK/StringBuilder.h | 12 ++++++------ 1 file 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