1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:37:46 +00:00

AK: Annotate StringBuilder functions as [[nodiscard]]

This commit is contained in:
Brian Gianforcaro 2021-04-11 02:31:30 -07:00 committed by Andreas Kling
parent 23454cab46
commit 7db74a6b3e

View file

@ -57,15 +57,15 @@ public:
vformat(*this, fmtstr.view(), VariadicFormatParams { parameters... }); vformat(*this, fmtstr.view(), VariadicFormatParams { parameters... });
} }
String build() const; [[nodiscard]] String build() const;
String to_string() const; [[nodiscard]] String to_string() const;
ByteBuffer to_byte_buffer() const; [[nodiscard]] ByteBuffer to_byte_buffer() const;
StringView string_view() const; [[nodiscard]] StringView string_view() const;
void clear(); void clear();
size_t length() const { return m_length; } [[nodiscard]] size_t length() const { return m_length; }
bool is_empty() const { return m_length == 0; } [[nodiscard]] bool is_empty() const { return m_length == 0; }
void trim(size_t count) { m_length -= count; } void trim(size_t count) { m_length -= count; }
template<class SeparatorType, class CollectionType> template<class SeparatorType, class CollectionType>