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
commit 7db74a6b3e
Notes: sideshowbarker 2024-07-18 20:31:53 +09:00

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>