diff options
author | Nadrieril Feneanar | 2020-03-05 16:20:07 +0000 |
---|---|---|
committer | GitHub | 2020-03-05 16:20:07 +0000 |
commit | 3f9194f47185fe30c9e410aa7c5e651df9694b3f (patch) | |
tree | 6d24b2e824822134da4976b65b413dc09ca4e567 /dhall/src/syntax/ast/import.rs | |
parent | 2ca97e97f1718141d826a78ab3da8197b2d55c69 (diff) | |
parent | 8e6b020ba1426c215382a81395b809b688fa7726 (diff) |
Merge pull request #139 from Nadrieril/missing-features
Implement a bunch of missing features
Diffstat (limited to 'dhall/src/syntax/ast/import.rs')
-rw-r--r-- | dhall/src/syntax/ast/import.rs | 10 |
1 files changed, 5 insertions, 5 deletions
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<SubExpr> { +pub enum ImportTarget<SubExpr> { Local(FilePrefix, FilePath), Remote(URL<SubExpr>), Env(String), @@ -57,7 +57,7 @@ pub enum Hash { #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Import<SubExpr> { pub mode: ImportMode, - pub location: ImportLocation<SubExpr>, + pub location: ImportTarget<SubExpr>, pub hash: Option<Hash>, } @@ -77,12 +77,12 @@ impl<SE> URL<SE> { } } -impl<SE> ImportLocation<SE> { +impl<SE> ImportTarget<SE> { pub fn traverse_ref<'a, Err, SE2>( &'a self, f: impl FnOnce(&'a SE) -> Result<SE2, Err>, - ) -> Result<ImportLocation<SE2>, Err> { - use ImportLocation::*; + ) -> Result<ImportTarget<SE2>, Err> { + use ImportTarget::*; Ok(match self { Local(prefix, path) => Local(*prefix, path.clone()), Remote(url) => Remote(url.traverse_ref(f)?), |