mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-28 20:29:42 +00:00
LibCore: Make IODevice::read_line() return a String
Almost everyone using this API actually wanted String instead of a ByteBuffer anyway, and there were a bunch of slightly different ways clients would convert to String. Let's just cut out all the confusion and make it return String. :^)
This commit is contained in:
@@ -53,7 +53,7 @@ ByteBuffer TLSv12::read(size_t max_size)
|
||||
return {};
|
||||
}
|
||||
|
||||
ByteBuffer TLSv12::read_line(size_t max_size)
|
||||
String TLSv12::read_line(size_t max_size)
|
||||
{
|
||||
if (!can_read_line())
|
||||
return {};
|
||||
@@ -70,7 +70,7 @@ ByteBuffer TLSv12::read_line(size_t max_size)
|
||||
auto buffer = ByteBuffer::copy(start, offset);
|
||||
m_context.application_buffer = m_context.application_buffer.slice(offset + 1, m_context.application_buffer.size() - offset - 1);
|
||||
|
||||
return buffer;
|
||||
return String::copy(buffer);
|
||||
}
|
||||
|
||||
bool TLSv12::write(const ByteBuffer& buffer)
|
||||
|
||||
Reference in New Issue
Block a user