Skip to content

Commit b96f442

Browse files
committed
Do not error out when uri is not file path (file://).
Close #381.
1 parent fce440d commit b96f442

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/types.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -775,8 +775,7 @@ pub trait Filepath {
775775

776776
impl Filepath for Url {
777777
fn filepath(&self) -> Result<PathBuf> {
778-
self.to_file_path()
779-
.map_err(|_| format_err!("Uri is not valid file path: {:?}", self))
778+
self.to_file_path().or_else(|_| Ok(self.as_str().into()))
780779
}
781780
}
782781

0 commit comments

Comments
 (0)