Skip to content

Add FilePath newtype #130

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

Merged
merged 8 commits into from
Apr 27, 2025
Merged

Add FilePath newtype #130

merged 8 commits into from
Apr 27, 2025

Conversation

ginnyTheCat
Copy link
Collaborator

@ginnyTheCat ginnyTheCat commented Apr 23, 2025

This creates a FilePath newtype, as mupdf requires paths to be UTF-8 on windows.

It supports AsRefing from:

  • str on all platforms
  • [u8] on all platforms, but windows
  • OsStr and Path on unix and wasi

On top of that Debug is implemented and TryFrom is implemented for OsStr and Path.

Thanks to @kirawi for discovering this limitation of mupdf and implementing it in mupdf-rs in #122.

@ginnyTheCat ginnyTheCat marked this pull request as ready for review April 24, 2025 13:19
Copy link
Collaborator

@itsjunetime itsjunetime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense to me

@messense messense merged commit 20b98ab into messense:main Apr 27, 2025
11 checks passed
@ginnyTheCat ginnyTheCat deleted the file-path branch April 27, 2025 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants