From 903d6c0bba36a6696eb337ae84b962f4cc48b5b5 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Wed, 4 Mar 2020 21:26:01 +0000 Subject: Implement remote imports and cleanup import chaining --- dhall/src/syntax/ast/import.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'dhall/src/syntax/ast/import.rs') diff --git a/dhall/src/syntax/ast/import.rs b/dhall/src/syntax/ast/import.rs index 7bde6e0..75d7946 100644 --- a/dhall/src/syntax/ast/import.rs +++ b/dhall/src/syntax/ast/import.rs @@ -18,7 +18,7 @@ pub struct FilePath { /// The location of import (i.e. local vs. remote vs. environment) #[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub enum ImportLocation { +pub enum ImportTarget { Local(FilePrefix, FilePath), Remote(URL), Env(String), @@ -57,7 +57,7 @@ pub enum Hash { #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Import { pub mode: ImportMode, - pub location: ImportLocation, + pub location: ImportTarget, pub hash: Option, } @@ -77,12 +77,12 @@ impl URL { } } -impl ImportLocation { +impl ImportTarget { pub fn traverse_ref<'a, Err, SE2>( &'a self, f: impl FnOnce(&'a SE) -> Result, - ) -> Result, Err> { - use ImportLocation::*; + ) -> Result, Err> { + use ImportTarget::*; Ok(match self { Local(prefix, path) => Local(*prefix, path.clone()), Remote(url) => Remote(url.traverse_ref(f)?), -- cgit v1.2.3