From 9741e3280ed03920732430e7994e1f8482c9ddd6 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sat, 6 Apr 2019 17:48:13 +0200 Subject: s/DhallError/ImportError/ --- dhall/src/imports.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'dhall/src') diff --git a/dhall/src/imports.rs b/dhall/src/imports.rs index 96268ca..95cf6fa 100644 --- a/dhall/src/imports.rs +++ b/dhall/src/imports.rs @@ -22,7 +22,7 @@ pub enum ImportRoot { fn resolve_import( import: &Import, root: &ImportRoot, -) -> Result, DhallError> { +) -> Result, ImportError> { use self::ImportRoot::*; use dhall_core::FilePrefix::*; use dhall_core::ImportLocation::*; @@ -43,23 +43,23 @@ fn resolve_import( } #[derive(Debug)] -pub enum DhallError { +pub enum ImportError { ParseError(ParseError), IOError(std::io::Error), } -impl From for DhallError { +impl From for ImportError { fn from(e: ParseError) -> Self { - DhallError::ParseError(e) + ImportError::ParseError(e) } } -impl From for DhallError { +impl From for ImportError { fn from(e: std::io::Error) -> Self { - DhallError::IOError(e) + ImportError::IOError(e) } } -impl fmt::Display for DhallError { +impl fmt::Display for ImportError { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { - use self::DhallError::*; + use self::ImportError::*; match self { ParseError(e) => e.fmt(f), IOError(e) => e.fmt(f), @@ -70,7 +70,7 @@ impl fmt::Display for DhallError { pub fn load_dhall_file( f: &Path, resolve_imports: bool, -) -> Result, DhallError> { +) -> Result, ImportError> { let mut buffer = String::new(); File::open(f)?.read_to_string(&mut buffer)?; let expr = parse_expr(&*buffer)?; @@ -88,7 +88,7 @@ pub fn load_dhall_file( pub fn load_dhall_file_no_resolve_imports( f: &Path, -) -> Result { +) -> Result { let mut buffer = String::new(); File::open(f)?.read_to_string(&mut buffer)?; let expr = parse_expr(&*buffer)?; -- cgit v1.2.3