From 66260f8e386f7a447352bd8ccbda064b00b698bc Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Tue, 13 Aug 2019 23:44:52 +0200 Subject: Implement inline headers parsing --- dhall_syntax/src/printer.rs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'dhall_syntax/src/printer.rs') diff --git a/dhall_syntax/src/printer.rs b/dhall_syntax/src/printer.rs index 5f5f99b..256ea65 100644 --- a/dhall_syntax/src/printer.rs +++ b/dhall_syntax/src/printer.rs @@ -230,7 +230,7 @@ where f.write_str(close) } -impl Display for InterpolatedText { +impl Display for InterpolatedText { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { f.write_str("\"")?; for x in self.iter() { @@ -344,10 +344,11 @@ impl Display for Hash { } } } -impl Display for ImportHashed { +impl Display for Import { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { use FilePrefix::*; use ImportLocation::*; + use ImportMode::*; let fmt_remote_path_component = |s: &str| -> String { use percent_encoding::{ utf8_percent_encode, PATH_SEGMENT_ENCODE_SET, @@ -423,14 +424,6 @@ impl Display for ImportHashed { write!(f, " ")?; hash.fmt(f)?; } - Ok(()) - } -} - -impl Display for Import { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { - self.location_hashed.fmt(f)?; - use ImportMode::*; match self.mode { Code => {} RawText => write!(f, " as Text")?, -- cgit v1.2.3