1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 19:47:34 +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

@ -88,7 +88,7 @@ DeprecatedString CookieJar::get_cookie(const URL& url, Web::Cookie::Source sourc
builder.appendff("{}={}", cookie.name, cookie.value);
}
return builder.build();
return builder.to_deprecated_string();
}
void CookieJar::set_cookie(const URL& url, Web::Cookie::ParsedCookie const& parsed_cookie, Web::Cookie::Source source)
@ -150,7 +150,7 @@ void CookieJar::dump_cookies()
builder.appendff("\t{}SameSite{} = {:s}\n", attribute_color, no_color, Web::Cookie::same_site_to_string(cookie.same_site));
});
dbgln("{} cookies stored\n{}", total_cookies, builder.build());
dbgln("{} cookies stored\n{}", total_cookies, builder.to_deprecated_string());
}
Vector<Web::Cookie::Cookie> CookieJar::get_all_cookies()

View file

@ -518,7 +518,7 @@ Optional<URL> Tab::url_from_location_bar(MayAppendTLD may_append_tld)
builder.append(".com"sv);
}
}
DeprecatedString final_text = builder.to_deprecated_string();
auto final_text = builder.to_deprecated_string();
auto url = url_from_user_input(final_text);
return url;

View file

@ -90,6 +90,6 @@ void CharacterSearchWidget::search()
StringBuilder builder;
builder.append_code_point(code_point);
model.add_result({ code_point, builder.build(), move(display_name) });
model.add_result({ code_point, builder.to_deprecated_string(), move(display_name) });
});
}

View file

@ -100,7 +100,7 @@ static TitleAndText build_backtrace(Coredump::Reader const& coredump, ELF::Core:
return {
DeprecatedString::formatted("Thread #{} (TID {})", thread_index, thread_info.tid),
builder.build()
builder.to_deprecated_string()
};
}
@ -125,7 +125,7 @@ static TitleAndText build_cpu_registers(const ELF::Core::ThreadInfo& thread_info
return {
DeprecatedString::formatted("Thread #{} (TID {})", thread_index, thread_info.tid),
builder.build()
builder.to_deprecated_string()
};
}

View file

@ -144,7 +144,7 @@ void do_copy(Vector<DeprecatedString> const& selected_file_paths, FileOperation
auto url = URL::create_with_file_scheme(path);
copy_text.appendff("{}\n", url);
}
GUI::Clipboard::the().set_data(copy_text.build().bytes(), "text/uri-list");
GUI::Clipboard::the().set_data(copy_text.to_deprecated_string().bytes(), "text/uri-list");
}
void do_paste(DeprecatedString const& target_directory, GUI::Window* window)
@ -213,7 +213,7 @@ void do_create_archive(Vector<DeprecatedString> const& selected_file_paths, GUI:
if (!archive_name.ends_with(".zip"sv))
path_builder.append(".zip"sv);
}
auto output_path = path_builder.build();
auto output_path = path_builder.to_deprecated_string();
pid_t zip_pid = fork();
if (zip_pid < 0) {

View file

@ -146,7 +146,7 @@ static DeprecatedString get_absolute_path_to_selected_node(SpaceAnalyzer::TreeMa
TreeNode const* node = treemapwidget.path_node(k);
path_builder.append(node->name());
}
return path_builder.build();
return path_builder.to_deprecated_string();
}
ErrorOr<int> serenity_main(Main::Arguments arguments)

View file

@ -42,7 +42,7 @@ void Cell::set_data(JS::Value new_data)
StringBuilder builder;
builder.append(new_data.to_string_without_side_effects());
m_data = builder.build();
m_data = builder.to_deprecated_string();
m_evaluated_data = move(new_data);
}

View file

@ -43,7 +43,7 @@ DeprecatedString format_double(char const* format, double value)
auto putch = [&](auto, auto ch) { builder.append(ch); };
printf_internal<decltype(putch), PrintfImpl, double, SingleEntryListNext>(putch, nullptr, format, value);
return builder.build();
return builder.to_deprecated_string();
}
}

View file

@ -745,7 +745,7 @@ DeprecatedString Sheet::generate_inline_documentation_for(StringView function, s
}
builder.append(')');
return builder.build();
return builder.to_deprecated_string();
}
DeprecatedString Position::to_cell_identifier(Sheet const& sheet) const