summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-05-07 20:47:25 +0200
committerAndreas Kling <kling@serenityos.org>2021-05-07 21:12:09 +0200
commitc7e9b6d00f728a59f0e8953c3dc851bc975b805b (patch)
treee5afb08508256bacd832dc1d579476d0a1bf4021 /Userland
parenteb05931ab504cafee47952e2d4c7c3f2df08b784 (diff)
downloadserenity-c7e9b6d00f728a59f0e8953c3dc851bc975b805b.zip
LibWeb: Convert StringBuilder::appendf() => AK::Format
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibWeb/Bindings/LocationObject.cpp6
-rw-r--r--Userland/Libraries/LibWeb/Dump.cpp2
2 files changed, 2 insertions, 6 deletions
diff --git a/Userland/Libraries/LibWeb/Bindings/LocationObject.cpp b/Userland/Libraries/LibWeb/Bindings/LocationObject.cpp
index c27f3ddd98..f42b2548fb 100644
--- a/Userland/Libraries/LibWeb/Bindings/LocationObject.cpp
+++ b/Userland/Libraries/LibWeb/Bindings/LocationObject.cpp
@@ -74,11 +74,7 @@ JS_DEFINE_NATIVE_GETTER(LocationObject::host_getter)
{
auto& window = static_cast<WindowObject&>(global_object);
auto url = window.impl().document().url();
- StringBuilder builder;
- builder.append(url.host());
- builder.append(':');
- builder.appendf("%u", url.port());
- return JS::js_string(vm, builder.to_string());
+ return JS::js_string(vm, String::formatted("{}:{}", url.host(), url.port()));
}
JS_DEFINE_NATIVE_GETTER(LocationObject::hash_getter)
diff --git a/Userland/Libraries/LibWeb/Dump.cpp b/Userland/Libraries/LibWeb/Dump.cpp
index c5497d96a6..abc35aca2f 100644
--- a/Userland/Libraries/LibWeb/Dump.cpp
+++ b/Userland/Libraries/LibWeb/Dump.cpp
@@ -243,7 +243,7 @@ void dump_tree(StringBuilder& builder, const Layout::Node& layout_node, bool sho
for (auto& property : properties) {
for (size_t i = 0; i < indent; ++i)
builder.append(" ");
- builder.appendf(" (%s: %s)\n", property.name.characters(), property.value.characters());
+ builder.appendff(" ({}: {})\n", property.name, property.value);
}
}