aboutsummaryrefslogtreecommitdiff
path: root/src/value.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/value.rs')
-rw-r--r--src/value.rs44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/value.rs b/src/value.rs
index 38dfe1f..5bb0c55 100644
--- a/src/value.rs
+++ b/src/value.rs
@@ -1,4 +1,4 @@
-//! Definition of a TOML value
+//! Definition of a MILF value
use std::collections::{BTreeMap, HashMap};
use std::fmt;
@@ -17,36 +17,36 @@ pub use crate::datetime::{Datetime, DatetimeParseError};
pub use crate::map::Map;
-/// Representation of a TOML value.
+/// Representation of a MILF value.
#[derive(PartialEq, Clone, Debug)]
pub enum Value {
- /// Represents a TOML string
+ /// Represents a MILF string
String(String),
- /// Represents a TOML integer
+ /// Represents a MILF integer
Integer(i64),
- /// Represents a TOML float
+ /// Represents a MILF float
Float(f64),
- /// Represents a TOML boolean
+ /// Represents a MILF boolean
Boolean(bool),
- /// Represents a TOML datetime
+ /// Represents a MILF datetime
Datetime(Datetime),
- /// Represents a TOML array
+ /// Represents a MILF array
Array(Array),
- /// Represents a TOML table
+ /// Represents a MILF table
Table(Table),
}
-/// Type representing a TOML array, payload of the `Value::Array` variant
+/// Type representing a MILF array, payload of the `Value::Array` variant
pub type Array = Vec<Value>;
-/// Type representing a TOML table, payload of the `Value::Table` variant.
+/// Type representing a MILF table, payload of the `Value::Table` variant.
/// By default it is backed by a BTreeMap, enable the `preserve_order` feature
/// to use a LinkedHashMap instead.
pub type Table = Map<String, Value>;
impl Value {
- /// Convert a `T` into `toml::Value` which is an enum that can represent
- /// any valid TOML data.
+ /// Convert a `T` into `milf::Value` which is an enum that can represent
+ /// any valid MILF data.
///
/// This conversion can fail if `T`'s implementation of `Serialize` decides to
/// fail, or if `T` contains a map with non-string keys.
@@ -57,14 +57,14 @@ impl Value {
value.serialize(Serializer)
}
- /// Interpret a `toml::Value` as an instance of type `T`.
+ /// Interpret a `milf::Value` as an instance of type `T`.
///
/// This conversion can fail if the structure of the `Value` does not match the
/// structure expected by `T`, for example if `T` is a struct type but the
- /// `Value` contains something other than a TOML table. It can also fail if the
+ /// `Value` contains something other than a MILF table. It can also fail if the
/// structure is correct but `T`'s implementation of `Deserialize` decides that
/// something is wrong with the data, for example required struct fields are
- /// missing from the TOML map or some number is too big to fit in the expected
+ /// missing from the MILF map or some number is too big to fit in the expected
/// primitive type.
pub fn try_into<'de, T>(self) -> Result<T, crate::de::Error>
where
@@ -73,7 +73,7 @@ impl Value {
de::Deserialize::deserialize(self)
}
- /// Index into a TOML array or map. A string index can be used to access a
+ /// Index into a MILF array or map. A string index can be used to access a
/// value in a map, and a usize index can be used to access an element of an
/// array.
///
@@ -85,7 +85,7 @@ impl Value {
index.index(self)
}
- /// Mutably index into a TOML array or map. A string index can be used to
+ /// Mutably index into a MILF array or map. A string index can be used to
/// access a value in a map, and a usize index can be used to access an
/// element of an array.
///
@@ -151,7 +151,7 @@ impl Value {
/// Extracts the datetime value if it is a datetime.
///
- /// Note that a parsed TOML value will only contain ISO 8601 dates. An
+ /// Note that a parsed MILF value will only contain ISO 8601 dates. An
/// example date is:
///
/// ```notrust
@@ -302,13 +302,13 @@ impl_into_value!(Boolean: bool);
impl_into_value!(Datetime: Datetime);
impl_into_value!(Table: Table);
-/// Types that can be used to index a `toml::Value`
+/// Types that can be used to index a `milf::Value`
///
/// Currently this is implemented for `usize` to index arrays and `str` to index
/// tables.
///
/// This trait is sealed and not intended for implementation outside of the
-/// `toml` crate.
+/// `milf` crate.
pub trait Index: Sealed {
#[doc(hidden)]
fn index<'a>(&self, val: &'a Value) -> Option<&'a Value>;
@@ -453,7 +453,7 @@ impl<'de> de::Deserialize<'de> for Value {
type Value = Value;
fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
- formatter.write_str("any valid TOML value")
+ formatter.write_str("any valid MILF value")
}
fn visit_bool<E>(self, value: bool) -> Result<Value, E> {