1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 13:17:44 +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:
Linus Groh 2023-01-26 18:58:09 +00:00
parent da81041e97
commit 6e7459322d
129 changed files with 213 additions and 219 deletions

View file

@ -371,7 +371,7 @@ public:)~~~");
builder.append(", "sv);
}
message_generator.set("message.constructor_call_parameters", builder.build());
message_generator.set("message.constructor_call_parameters", builder.to_deprecated_string());
message_generator.appendln(R"~~~(
return make<@message.pascal_name@>(@message.constructor_call_parameters@);
})~~~");

View file

@ -86,7 +86,7 @@ static ErrorOr<DeprecatedString> decode_html_entities(StringView const& str)
start = entity_end.value() + 1;
}
return decoded_str.build();
return decoded_str.to_deprecated_string();
}
static ErrorOr<ApprovalDate> parse_approval_date(StringView const& str)

View file

@ -1667,7 +1667,7 @@ static ErrorOr<void> parse_all_locales(DeprecatedString core_path, DeprecatedStr
if (auto region = cldr.unique_strings.get(parsed_locale.region); !region.is_empty())
builder.appendff("-{}", region);
return builder.build();
return builder.to_deprecated_string();
};
while (dates_iterator.has_next()) {

View file

@ -936,7 +936,7 @@ static ErrorOr<void> parse_all_locales(DeprecatedString bcp47_path, DeprecatedSt
if (auto region = cldr.unique_strings.get(parsed_locale.region); !region.is_empty())
builder.appendff("-{}", region);
return builder.build();
return builder.to_deprecated_string();
};
while (identity_iterator.has_next()) {

View file

@ -86,7 +86,7 @@ struct AK::Formatter<NumberFormat> : Formatter<FormatString> {
format.zero_format_index,
format.positive_format_index,
format.negative_format_index,
identifier_indices.build());
identifier_indices.to_deprecated_string());
}
};
@ -718,7 +718,7 @@ static ErrorOr<void> parse_all_locales(DeprecatedString core_path, DeprecatedStr
if (auto region = cldr.unique_strings.get(parsed_locale.region); !region.is_empty())
builder.appendff("-{}", region);
return builder.build();
return builder.to_deprecated_string();
};
while (numbers_iterator.has_next()) {

View file

@ -410,7 +410,7 @@ static ErrorOr<void> parse_all_locales(DeprecatedString core_path, DeprecatedStr
if (auto region = cldr.unique_strings.get(parsed_locale.region); !region.is_empty())
builder.appendff("-{}", region);
return builder.build();
return builder.to_deprecated_string();
};
while (identity_iterator.has_next()) {

View file

@ -150,7 +150,7 @@ static ErrorOr<void> parse_all_locales(DeprecatedString dates_path, CLDR& cldr)
if (auto region = cldr.unique_strings.get(parsed_locale.region); !region.is_empty())
builder.appendff("-{}", region);
return builder.build();
return builder.to_deprecated_string();
};
while (dates_iterator.has_next()) {

View file

@ -45,7 +45,7 @@ static void set_image_path_for_emoji(StringView emoji_resource_path, Emoji& emoj
builder.appendff("U+{:X}", code_point);
}
auto path = DeprecatedString::formatted("{}/{}.png", emoji_resource_path, builder.build());
auto path = DeprecatedString::formatted("{}/{}.png", emoji_resource_path, builder.to_deprecated_string());
if (Core::File::exists(path))
emoji.image_path = move(path);
}
@ -153,7 +153,7 @@ static ErrorOr<void> parse_emoji_serenity_data(Core::Stream::BufferedFile& file,
}
});
auto name = builder.build();
auto name = builder.to_deprecated_string();
if (!any_of(name, is_ascii_lower_alpha))
name = name.to_titlecase();