Skip to content

Use &Path instead of &str for path in write_to_path#52

Open
tarneaux wants to merge 3 commits into
TianyiShi2001:mainfrom
tarneaux:main
Open

Use &Path instead of &str for path in write_to_path#52
tarneaux wants to merge 3 commits into
TianyiShi2001:mainfrom
tarneaux:main

Conversation

@tarneaux

Copy link
Copy Markdown

Since all underlying crates use a &Path as the type for writing, it makes much more sense to just use that as the type for write_to_path, especially since strs can be freely cast to Paths, but Paths can't be cast to strs all the time (since on some OSes, non-unicode characters are allowed in paths).

Since all underlying crates use a &Path as the type for writing, it
makes much more sense to just use that as the type for `write_to_path`,
especially since strs can be freely cast to Paths, but Paths can't be
cast to strs all the time (since on some OSes, non-unicode characters
are allowed in paths).
@pinkforest

Copy link
Copy Markdown
Collaborator

How about AsPath which also coerces from &'a str

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.

2 participants