diff options
Diffstat (limited to '')
-rw-r--r-- | serde_dhall/src/lib.rs | 4 | ||||
-rw-r--r-- | serde_dhall/src/simple.rs | 8 | ||||
-rw-r--r-- | serde_dhall/src/value.rs | 3 |
3 files changed, 6 insertions, 9 deletions
diff --git a/serde_dhall/src/lib.rs b/serde_dhall/src/lib.rs index e59255c..19d3f7e 100644 --- a/serde_dhall/src/lib.rs +++ b/serde_dhall/src/lib.rs @@ -174,7 +174,7 @@ doc_comment::doctest!("../../README.md"); /// Finer-grained control over deserializing Dhall values pub mod options; -/// Serde-compatible Dhall values and their type +/// Serde-compatible Dhall types pub mod simple; /// Arbitrary Dhall values pub mod value; @@ -192,6 +192,6 @@ pub use deserialize::Deserialize; pub(crate) use deserialize::Sealed; pub use error::{Error, Result}; pub use shortcuts::{from_str, from_str_manual_type, from_str_static_type}; -pub use simple::{Type as SimpleType, Value as SimpleValue}; +pub use simple::{Type as SimpleType}; pub use static_type::StaticType; pub use value::Value; diff --git a/serde_dhall/src/simple.rs b/serde_dhall/src/simple.rs index 3d77853..6f3dc93 100644 --- a/serde_dhall/src/simple.rs +++ b/serde_dhall/src/simple.rs @@ -6,14 +6,13 @@ use dhall::syntax::{Builtin, ExprKind, NumKind, Span}; use crate::{Deserialize, Error, Result, Sealed}; /// A simple value of the kind that can be encoded/decoded with serde -/// TODO #[derive(Debug, Clone, PartialEq, Eq)] -pub struct Value { +pub(crate) struct Value { kind: Box<ValKind>, } #[derive(Debug, Clone, PartialEq, Eq)] -pub enum ValKind { +pub(crate) enum ValKind { // TODO: redefine NumKind locally Num(NumKind), Text(String), @@ -24,8 +23,7 @@ pub enum ValKind { Union(String, Option<Value>), } -/// The type of a `simple::Value`. -/// TODO +/// The type of a value that can be decoded by Serde. For example, `{ x: Bool, y: List Natural }`. #[derive(Debug, Clone, PartialEq, Eq)] pub struct Type { kind: Box<TyKind>, diff --git a/serde_dhall/src/value.rs b/serde_dhall/src/value.rs index 2557efe..41a96ea 100644 --- a/serde_dhall/src/value.rs +++ b/serde_dhall/src/value.rs @@ -26,8 +26,7 @@ impl Value { } /// Converts a Value into a SimpleValue. - /// TODO - pub fn to_simple_value(&self) -> Option<SimpleValue> { + pub(crate) fn to_simple_value(&self) -> Option<SimpleValue> { self.as_simple_val.clone() } /// Converts a Value into a SimpleType. |