-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds unzip module #53
Conversation
Allows downloading and extracting zips from urls
let reader = std::io::Cursor::new(content); | ||
let mut archive = ZipArchive::new(reader)?; | ||
|
||
for i in 0..archive.len() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm kinda dumbfounded that there's no Iterator for this. oh well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Felt weird to me so I looked it up, https://users.rust-lang.org/t/is-it-possible-to-create-an-iterator-for-ziparchive-in-zip-crate/5744/3
tldr you can’t make an Iterator that takes a ZipArchive and yields ZipFile items. This is because a ZipFile mutably borrows the ZipArchive's reader, so a single archive can only have one ZipFile at a time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spooky! 👻
Co-authored-by: Rohesie <[email protected]>
@tgstation/rust-g-dev-team meep |
Allows downloading and extracting zips from urls
Closes #50
Needed for out of repo maps