From 405bc3d80c0e169ea74dd12422b9504b7383dab3 Mon Sep 17 00:00:00 2001 From: FintanH Date: Mon, 12 Aug 2019 22:22:24 +0100 Subject: 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. --- dhall_syntax/src/printer.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'dhall_syntax/src/printer.rs') 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)?; -- cgit v1.2.3