mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:27:45 +00:00
AK: Remove the fallible constructor from FixedMemoryStream
This commit is contained in:
parent
8b2f23d016
commit
220fbcaa7e
31 changed files with 185 additions and 209 deletions
|
@ -202,13 +202,13 @@ bool QOIImageDecoderPlugin::initialize()
|
|||
|
||||
ErrorOr<bool> QOIImageDecoderPlugin::sniff(ReadonlyBytes data)
|
||||
{
|
||||
auto stream = TRY(FixedMemoryStream::construct({ data.data(), data.size() }));
|
||||
return !decode_qoi_header(*stream).is_error();
|
||||
FixedMemoryStream stream { { data.data(), data.size() } };
|
||||
return !decode_qoi_header(stream).is_error();
|
||||
}
|
||||
|
||||
ErrorOr<NonnullOwnPtr<ImageDecoderPlugin>> QOIImageDecoderPlugin::create(ReadonlyBytes data)
|
||||
{
|
||||
auto stream = TRY(FixedMemoryStream::construct(data));
|
||||
auto stream = TRY(try_make<FixedMemoryStream>(data));
|
||||
return adopt_nonnull_own_or_enomem(new (nothrow) QOIImageDecoderPlugin(move(stream)));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue