-
Notifications
You must be signed in to change notification settings - Fork 432
fix(fs): can't use Windows path #1710
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
Conversation
Package Changes Through 3c53ac6There are 3 changes which include dialog with prerelease, window-state with prerelease, fs with prerelease Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
Path(SafePathBuf), | ||
} | ||
|
||
impl<'de> serde::Deserialize<'de> for SafeFilePath { |
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 see that we have a duplicated enum definition with and now same deserialize implementation, maybe we can combine this logic into one, by using generics? and still export aliases without a generic:
enum FilePathOrUrl<T: FromStr> {
Url(url::Url),
Path(T),
}
pub type SafeFilePath = FilePath<SafeFilePath>;
pub type FilePath = FilePath<PathBuf>;
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.
enum FilePathOrUrl<T: FromStr> { Url(url::Url), Path(T), } pub type SafeFilePath = FilePath<SafeFilePath>; pub type FilePath = FilePath<PathBuf>;
I'm not sure how that'll work, SafeFilePath
doesn't implement FromStr
, and that means we either need to do it in tauri or we need a wrapper
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.
The best is to implement FromStr
on in tauri. For now, we can just add a TODO then or merge as is.
Also I think we should add some tests in this PR, just to ensure we don't regress again |
* Fix fs can't use Windows path * Add change file * Implement `Deserialize` instead * Rename FilePath's visitor to FilePathVisitor * Add todo and test * Clippy * Unused variable
Url deserializes Windows drive letter to url scheme which is not what we wanted, since we don't use single letter schemes anyways, we can just assume a single letter scheme url to be a path not a url
Fix #1704