summaryrefslogtreecommitdiff
path: root/AK/Format.h
diff options
context:
space:
mode:
authorMacDue <macdue@dueutil.tech>2023-02-05 19:02:54 +0000
committerLinus Groh <mail@linusgroh.de>2023-02-08 19:15:45 +0000
commit63b11030f03e5a0fd06d9c8cfa788da0388096d8 (patch)
tree3ea0fa1e751683b643c71da95b6ecf98a97508cf /AK/Format.h
parent1c92e6ee9d1f686f20f37445150d63ae474b7e9b (diff)
downloadserenity-63b11030f03e5a0fd06d9c8cfa788da0388096d8.zip
Everywhere: Use ReadonlySpan<T> instead of Span<T const>
Diffstat (limited to 'AK/Format.h')
-rw-r--r--AK/Format.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/AK/Format.h b/AK/Format.h
index 6f9ffe1d9b..c86412c556 100644
--- a/AK/Format.h
+++ b/AK/Format.h
@@ -264,13 +264,13 @@ private:
class TypeErasedFormatParams {
public:
- Span<TypeErasedParameter const> parameters() const { return m_parameters; }
+ ReadonlySpan<TypeErasedParameter> parameters() const { return m_parameters; }
- void set_parameters(Span<TypeErasedParameter const> parameters) { m_parameters = parameters; }
+ void set_parameters(ReadonlySpan<TypeErasedParameter> parameters) { m_parameters = parameters; }
size_t take_next_index() { return m_next_index++; }
private:
- Span<TypeErasedParameter const> m_parameters;
+ ReadonlySpan<TypeErasedParameter> m_parameters;
size_t m_next_index { 0 };
};
@@ -359,14 +359,14 @@ struct Formatter<StringView> : StandardFormatter {
template<typename T>
requires(HasFormatter<T>)
-struct Formatter<Span<T const>> : StandardFormatter {
+struct Formatter<ReadonlySpan<T>> : StandardFormatter {
Formatter() = default;
explicit Formatter(StandardFormatter formatter)
: StandardFormatter(move(formatter))
{
}
- ErrorOr<void> format(FormatBuilder& builder, Span<T const> value)
+ ErrorOr<void> format(FormatBuilder& builder, ReadonlySpan<T> value)
{
if (m_mode == Mode::Pointer) {
Formatter<FlatPtr> formatter { *this };
@@ -406,19 +406,19 @@ struct Formatter<Span<T const>> : StandardFormatter {
template<typename T>
requires(HasFormatter<T>)
-struct Formatter<Span<T>> : Formatter<Span<T const>> {
+struct Formatter<Span<T>> : Formatter<ReadonlySpan<T>> {
ErrorOr<void> format(FormatBuilder& builder, Span<T> value)
{
- return Formatter<Span<T const>>::format(builder, value);
+ return Formatter<ReadonlySpan<T>>::format(builder, value);
}
};
template<typename T, size_t inline_capacity>
requires(HasFormatter<T>)
-struct Formatter<Vector<T, inline_capacity>> : Formatter<Span<T const>> {
+struct Formatter<Vector<T, inline_capacity>> : Formatter<ReadonlySpan<T>> {
ErrorOr<void> format(FormatBuilder& builder, Vector<T, inline_capacity> const& value)
{
- return Formatter<Span<T const>>::format(builder, value.span());
+ return Formatter<ReadonlySpan<T>>::format(builder, value.span());
}
};