mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 23:47:45 +00:00
AK: Remove StringBuilder::build() in favor of to_deprecated_string()
Having an alias function that only wraps another one is silly, and keeping the more obvious name should flush out more uses of deprecated strings. No behavior change.
This commit is contained in:
parent
da81041e97
commit
6e7459322d
129 changed files with 213 additions and 219 deletions
|
@ -106,7 +106,7 @@ public:
|
|||
{
|
||||
StringBuilder builder;
|
||||
builder.join(separator, collection, fmtstr);
|
||||
return builder.build();
|
||||
return builder.to_deprecated_string();
|
||||
}
|
||||
|
||||
[[nodiscard]] bool matches(StringView mask, CaseSensitivity = CaseSensitivity::CaseInsensitive) const;
|
||||
|
|
|
@ -52,7 +52,7 @@ DeprecatedString encode_hex(const ReadonlyBytes input)
|
|||
for (auto ch : input)
|
||||
output.appendff("{:02x}", ch);
|
||||
|
||||
return output.build();
|
||||
return output.to_deprecated_string();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ inline typename Builder::OutputType JsonArray::serialized() const
|
|||
{
|
||||
Builder builder;
|
||||
serialize(builder);
|
||||
return builder.build();
|
||||
return builder.to_deprecated_string();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -139,7 +139,7 @@ inline typename Builder::OutputType JsonObject::serialized() const
|
|||
{
|
||||
Builder builder;
|
||||
serialize(builder);
|
||||
return builder.build();
|
||||
return builder.to_deprecated_string();
|
||||
}
|
||||
|
||||
template<typename Builder>
|
||||
|
@ -190,7 +190,7 @@ inline typename Builder::OutputType JsonValue::serialized() const
|
|||
{
|
||||
Builder builder;
|
||||
serialize(builder);
|
||||
return builder.build();
|
||||
return builder.to_deprecated_string();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ public:
|
|||
}
|
||||
|
||||
StringView as_string_view() const { return m_builder.string_view(); }
|
||||
DeprecatedString as_string() const { return m_builder.build(); }
|
||||
DeprecatedString as_string() const { return m_builder.to_deprecated_string(); }
|
||||
|
||||
void append(StringView pattern)
|
||||
{
|
||||
|
|
|
@ -118,11 +118,6 @@ DeprecatedString StringBuilder::to_deprecated_string() const
|
|||
return DeprecatedString((char const*)data(), length());
|
||||
}
|
||||
|
||||
DeprecatedString StringBuilder::build() const
|
||||
{
|
||||
return to_deprecated_string();
|
||||
}
|
||||
|
||||
ErrorOr<String> StringBuilder::to_string() const
|
||||
{
|
||||
return String::from_utf8(string_view());
|
||||
|
|
|
@ -62,7 +62,6 @@ public:
|
|||
}
|
||||
|
||||
#ifndef KERNEL
|
||||
[[nodiscard]] DeprecatedString build() const;
|
||||
[[nodiscard]] DeprecatedString to_deprecated_string() const;
|
||||
ErrorOr<String> to_string() const;
|
||||
#endif
|
||||
|
|
|
@ -546,7 +546,7 @@ DeprecatedString replace(StringView str, StringView needle, StringView replaceme
|
|||
last_position = position + needle.length();
|
||||
}
|
||||
replaced_string.append(str.substring_view(last_position, str.length() - last_position));
|
||||
return replaced_string.build();
|
||||
return replaced_string.to_deprecated_string();
|
||||
}
|
||||
|
||||
ErrorOr<String> replace(String const& haystack, StringView needle, StringView replacement, ReplaceMode replace_mode)
|
||||
|
|
|
@ -348,7 +348,7 @@ DeprecatedString URL::serialize_origin() const
|
|||
builder.append(m_host);
|
||||
if (m_port.has_value())
|
||||
builder.appendff(":{}", *m_port);
|
||||
return builder.build();
|
||||
return builder.to_deprecated_string();
|
||||
}
|
||||
|
||||
bool URL::equals(URL const& other, ExcludeFragment exclude_fragments) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue