Everywhere: Split Error::from_string_literal and Error::from_string_view

Error::from_string_literal now takes direct char const*s, while
Error::from_string_view does what Error::from_string_literal used to do:
taking StringViews. This change will remove the need to insert `sv`
after error strings when returning string literal errors once
StringView(char const*) is removed.

No functional changes.
This commit is contained in:
sin-ack 2022-07-11 17:57:32 +00:00 committed by Andreas Kling
commit e5f09ea170
Notes: sideshowbarker 2024-07-17 09:27:09 +09:00
51 changed files with 282 additions and 261 deletions

View file

@ -998,15 +998,15 @@ size_t DDSImageDecoderPlugin::frame_count()
ErrorOr<ImageFrameDescriptor> DDSImageDecoderPlugin::frame(size_t index)
{
if (index > 0)
return Error::from_string_literal("DDSImageDecoderPlugin: Invalid frame index"sv);
return Error::from_string_literal("DDSImageDecoderPlugin: Invalid frame index");
if (m_context->state == DDSLoadingContext::State::Error)
return Error::from_string_literal("DDSImageDecoderPlugin: Decoding failed"sv);
return Error::from_string_literal("DDSImageDecoderPlugin: Decoding failed");
if (m_context->state < DDSLoadingContext::State::BitmapDecoded) {
bool success = decode_dds(*m_context);
if (!success)
return Error::from_string_literal("DDSImageDecoderPlugin: Decoding failed"sv);
return Error::from_string_literal("DDSImageDecoderPlugin: Decoding failed");
}
VERIFY(m_context->bitmap);