summaryrefslogtreecommitdiff
path: root/dhall/src/error
diff options
context:
space:
mode:
authorNadrieril2020-04-05 17:57:07 +0100
committerGitHub2020-04-05 17:57:07 +0100
commit7e977f282fb6a0eff0ef45738b9b5c98dc4c6fee (patch)
treead4249609707fd8720a44469152105c2f6a67c79 /dhall/src/error
parent5a5aa49e64197899006751db72e404f4b2292d4e (diff)
parent820214615547101f8f2b5de209b5189968bddfee (diff)
Merge pull request #154 from Nadrieril/cleanup-api
Rewrite serde_dhall API
Diffstat (limited to 'dhall/src/error')
-rw-r--r--dhall/src/error/builder.rs2
-rw-r--r--dhall/src/error/mod.rs14
2 files changed, 8 insertions, 8 deletions
diff --git a/dhall/src/error/builder.rs b/dhall/src/error/builder.rs
index c0bacb5..3ee65fb 100644
--- a/dhall/src/error/builder.rs
+++ b/dhall/src/error/builder.rs
@@ -6,7 +6,7 @@ use annotate_snippets::{
use crate::syntax::{ParsedSpan, Span};
#[derive(Debug, Clone, Default)]
-pub(crate) struct ErrorBuilder {
+pub struct ErrorBuilder {
title: FreeAnnotation,
annotations: Vec<SpannedAnnotation>,
footer: Vec<FreeAnnotation>,
diff --git a/dhall/src/error/mod.rs b/dhall/src/error/mod.rs
index e28b98b..ef4d41f 100644
--- a/dhall/src/error/mod.rs
+++ b/dhall/src/error/mod.rs
@@ -4,7 +4,7 @@ use crate::semantics::resolve::{ImportLocation, ImportStack};
use crate::syntax::{Import, ParseError};
mod builder;
-pub(crate) use builder::*;
+pub use builder::*;
pub type Result<T> = std::result::Result<T, Error>;
@@ -15,7 +15,7 @@ pub struct Error {
#[derive(Debug)]
#[non_exhaustive]
-pub(crate) enum ErrorKind {
+pub enum ErrorKind {
IO(IOError),
Parse(ParseError),
Decode(DecodeError),
@@ -25,7 +25,7 @@ pub(crate) enum ErrorKind {
}
#[derive(Debug)]
-pub(crate) enum ImportError {
+pub enum ImportError {
Missing,
MissingEnvVar,
SanityCheck,
@@ -53,21 +53,21 @@ pub struct TypeError {
/// The specific type error
#[derive(Debug)]
-pub(crate) enum TypeMessage {
+pub enum TypeMessage {
Custom(String),
}
impl Error {
- pub(crate) fn new(kind: ErrorKind) -> Self {
+ pub fn new(kind: ErrorKind) -> Self {
Error { kind }
}
- pub(crate) fn kind(&self) -> &ErrorKind {
+ pub fn kind(&self) -> &ErrorKind {
&self.kind
}
}
impl TypeError {
- pub(crate) fn new(message: TypeMessage) -> Self {
+ pub fn new(message: TypeMessage) -> Self {
TypeError { message }
}
}