Closed jbr closed 2 years ago
Yeah, as written this just requires a patch release, but unfortunately it also conflicts with compression 😞
I originally returned a value with the same lifetime as the type just like you've done, but when the file contents are lazily decompressed you will find the returned content's lifetime can't outlive self
.
Well... You can extend it to 'static
by leaking the allocation, but my opinion is that your API has problems if it can only be implemented by leaking memory.
Without this, the lifetime of
&self
is inferred, which might not live as long as'a
(often/always'static
)I believe this is semver-patch because
'a
always outlives the self borrow lifetime