cairo
cairo copied to clipboard
the `at` method on `Array` (and Span) returns `@T` while on `ByteArray` it returns `Option<T>`.
I think that keeping a consistent interface between the three is important for a good developer experience.
Proposal:
- First, introduce a
getmethod onByteArraythat returnsOption<T>(could even beOption<@T>if we want maximum consistency, but unlike for "natural" arrays this doesn't really make sense) - Refactor
atto returnT(or@T) or panic, like arrays - Refactor
ByteArrayIndexViewto just return whatself.at(index)returns, no more need for error management since we refactoredat()
I can submit a PR if agreed
(These should also be separate traits IMO instead of methods on array/bytearray)