-
Notifications
You must be signed in to change notification settings - Fork 3
Conversation
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.
LGTM -- I had some suggestions on docstrings but otherwise 👌
assert_eq!(Path::parse("/").unwrap().as_ref(), ""); | ||
assert_eq!(Path::parse("").unwrap().as_ref(), ""); | ||
|
||
let err = Path::parse("//").unwrap_err(); |
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.
👍
@@ -214,6 +271,18 @@ where | |||
} | |||
} | |||
|
|||
pub(crate) fn filesystem_path_to_url(path: impl AsRef<std::path::Path>) -> Result<Url, Error> { |
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.
Perhaps a docstring explaining what this does would be useful as well
src/path/mod.rs
Outdated
/// Convert a filesystem path to a [`Path`] relative to the provided base | ||
/// | ||
/// This will return an error if the path does not exist, contains illegal | ||
/// character sequences as defined by [`Path::parse`], or does not start |
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 found "provided prefix" confusing as I didn't know what it was referring to. It seems to mean that the path
must be prefixed by the the path in the base
URL, if specified
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.
Oh sorry, I renamed the parameters and forgot to update the docstring
A couple of things came up whilst implementing apache/datafusion#2677 that would make life easier.
Path::parse("/")
would return an errorstd::path::Path
toobject_store::path::Path
forLocalFileSystem
This PR addresses these