diff options
author | FintanH | 2019-08-12 22:22:24 +0100 |
---|---|---|
committer | FintanH | 2019-08-12 22:22:24 +0100 |
commit | 405bc3d80c0e169ea74dd12422b9504b7383dab3 (patch) | |
tree | f1f71797b0470375b12717a4663c1ea2ca1f96fd /dhall_syntax/src/printer.rs | |
parent | 8ec422f2319360f986950fcb9aae4bcf65a9c1e2 (diff) |
Refactor of File to be the combination of Directory and the file name,
where Directory is the Vector of component paths.
The refactor meant changing some sections of the code where we were
parsing and manipulating Files/Directories.
This also includes a new trait Canonicalization which is needed for
import logic.
Diffstat (limited to 'dhall_syntax/src/printer.rs')
-rw-r--r-- | dhall_syntax/src/printer.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/dhall_syntax/src/printer.rs b/dhall_syntax/src/printer.rs index dbed55d..8503a1e 100644 --- a/dhall_syntax/src/printer.rs +++ b/dhall_syntax/src/printer.rs @@ -380,17 +380,19 @@ impl Display for ImportHashed { Absolute => "", }; write!(f, "{}/", prefix)?; - let path: String = path - .iter() + let full_path: String = path + .clone() + .into_iter() .map(|c| fmt_local_path_component(c.as_ref())) .join("/"); - f.write_str(&path)?; + f.write_str(&full_path)?; } Remote(url) => { write!(f, "{}://{}/", url.scheme, url.authority,)?; let path: String = url .path - .iter() + .clone() + .into_iter() .map(|c| fmt_remote_path_component(c.as_ref())) .join("/"); f.write_str(&path)?; |