Skip to content

Commit bee9014

Browse files
Jaxkrchar
andauthored
Use Path.join() to create paths instead of Url.path() (#781)
We can't assume that the path section of a file:// URL is a valid operating system path, so instead we join the root and the source using Rust's std::path API. This still handles absolute paths the same. This commit resolves issues where we couldn't use ethcontract-derive on Windows (e.g. #729) Co-authored-by: videogame hacker <[email protected]>
1 parent e17ed0d commit bee9014

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ethcontract-generate/src/source.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ impl Source {
110110
let url = base.join(source.as_ref())?;
111111

112112
match url.scheme() {
113-
"file" => Ok(Source::local(url.path())),
113+
"file" => Ok(Source::local(root.join(source))),
114114
#[cfg(feature = "http")]
115115
"http" | "https" => match url.host_str() {
116116
Some("etherscan.io") => Source::etherscan(

0 commit comments

Comments
 (0)