zip-rs / zip-old

Zip implementation in Rust
MIT License
731 stars 204 forks source link

to_owned or OwnedZipFile method? #329

Closed cottrell closed 1 year ago

cottrell commented 1 year ago

I think it could be beneficial to have some to_owned method here and possibly elsewhere? Or is there perhaps a more fundament way of doing this?

https://docs.rs/zip/latest/zip/read/struct.ZipArchive.html#method.by_index

fn by_index2(self, file_number: usize) -> ZipResult<OwnedZipFile>
Plecra commented 1 year ago

I'm going to say we're not adding this for now (you're right though, it's a useful api!). If you'd like an owned zip file, use https://docs.rs/ouroboros to build a self referencing (ZipArchive, ZipFile<'_>).