Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The EpubDoc struct was unable read files in the epub archive on Windows due to the behavior of Pathbuf.join() method. This fix forcibly coerces the separators to Unix-style separators, so that the ZipArchive struct in the zip-rs dependency searches for the file at the proper file path. Previously on Windows, the EpubDoc resources contained paths with a mix of escaped windows separators and Unix separators (Example: OEBPS\Text/part0000.html).
This pull request creates a private helper function in the EpubDoc struct that replaces Windows separators with Unix separators. I did this instead of using each OS's respective path separator because upon testing it appeared that the ZipArchive struct from zip-rs requires paths with Unix separators or it will not be able to find the files within the archive.
I have tested this code on both Linux and Windows and it runs properly, so I assume that it would also run on MacOS as well.
It is a minor change, but feel free to edit and/or modify this request's code as you see fit. I still have much to learn about Rust, so there may well be better ways to write this function. Also, this is my first pull request, so I hope I have done everything properly.