summaryrefslogtreecommitdiff
path: root/dhall_core/src/printer.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--dhall_core/src/printer.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/dhall_core/src/printer.rs b/dhall_core/src/printer.rs
index e43f1be..bd38863 100644
--- a/dhall_core/src/printer.rs
+++ b/dhall_core/src/printer.rs
@@ -286,7 +286,19 @@ impl Display for Const {
impl Display for Import {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
- <Self as fmt::Debug>::fmt(self, f)
+ use FilePrefix::*;
+ use ImportLocation::*;
+ match &self.location {
+ Local(prefix, path) => {
+ let prefix = match prefix {
+ Here => ".",
+ Parent => "..",
+ Home => "~",
+ Absolute => "",
+ };
+ write!(f, "{}/{}", prefix, path.to_str().unwrap())
+ }
+ }
}
}