Closed tamird closed 1 year ago
A custom reader which reads fragments of a file on the fly would have to return Cow::Owned
, right?
I don't see why; can you help me understand?
What you're describing sounds mutable, but these methods take &self
.
@bjorn3 is correct. Using Cow
was an intentional design decision to allow a Reader
implementation like that. It would use interior mutability. As such, we won't be making this change.
The implementations of these methods always return references; formalize this in the API. The implementations of
Reader::to_slice
are all infallible; formalize this as well.