diff options
author | Andreas Kling <kling@serenityos.org> | 2021-04-21 23:45:08 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-04-21 23:49:03 +0200 |
commit | edf0b14e230d5f39ecf1d1be08435e1c9d7a78c3 (patch) | |
tree | ed44a677a64628d0dd618314d6c273ea93a84f26 /AK | |
parent | 0005fa0e2ba356434f41ff1673865142526387fd (diff) | |
download | serenity-edf0b14e230d5f39ecf1d1be08435e1c9d7a78c3.zip |
AK: Remove String::format()
There are no more clients of this function, everyone has been converted
to String::formatted().
Diffstat (limited to 'AK')
-rw-r--r-- | AK/String.cpp | 11 | ||||
-rw-r--r-- | AK/String.h | 4 |
2 files changed, 1 insertions, 14 deletions
diff --git a/AK/String.cpp b/AK/String.cpp index 0d979a8f6c..518e1f2dc9 100644 --- a/AK/String.cpp +++ b/AK/String.cpp @@ -30,7 +30,6 @@ #include <AK/Memory.h> #include <AK/StdLibExtras.h> #include <AK/String.h> -#include <AK/StringBuilder.h> #include <AK/StringView.h> #include <AK/Vector.h> @@ -232,16 +231,6 @@ template Optional<u16> String::to_uint() const; template Optional<u32> String::to_uint() const; template Optional<u64> String::to_uint() const; -String String::format(const char* fmt, ...) -{ - StringBuilder builder; - va_list ap; - va_start(ap, fmt); - builder.appendvf(fmt, ap); - va_end(ap); - return builder.to_string(); -} - bool String::starts_with(const StringView& str, CaseSensitivity case_sensitivity) const { return StringUtils::starts_with(*this, str, case_sensitivity); diff --git a/AK/String.h b/AK/String.h index 3c9b3feb01..a26edaecda 100644 --- a/AK/String.h +++ b/AK/String.h @@ -50,7 +50,7 @@ namespace AK { // // s = String("some literal"); // -// s = String::format("%d little piggies", m_piggies); +// s = String::formatted("{} little piggies", m_piggies); // // StringBuilder builder; // builder.append("abc"); @@ -265,8 +265,6 @@ public: return String((const char*)buffer.data(), buffer.size(), should_chomp); } - [[nodiscard]] static String format(const char*, ...) __attribute__((format(printf, 1, 2))); - [[nodiscard]] static String vformatted(StringView fmtstr, TypeErasedFormatParams); template<typename... Parameters> |