aboutsummaryrefslogtreecommitdiff
path: root/src/de.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/de.rs')
-rw-r--r--src/de.rs38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/de.rs b/src/de.rs
index 6411293..31904b5 100644
--- a/src/de.rs
+++ b/src/de.rs
@@ -1,6 +1,6 @@
-//! Deserializing TOML into Rust structures.
+//! Deserializing MILF into Rust structures.
//!
-//! This module contains all the Serde support for deserializing TOML documents
+//! This module contains all the Serde support for deserializing MILF documents
//! into Rust structures. Note that some top-level functions here are also
//! provided at the top of the crate.
@@ -22,13 +22,13 @@ use crate::datetime;
use crate::spanned;
use crate::tokens::{Error as TokenError, Span, Token, Tokenizer};
-/// Type Alias for a TOML Table pair
+/// Type Alias for a MILF Table pair
type TablePair<'a> = ((Span, Cow<'a, str>), Value<'a>);
/// Deserializes a byte slice into a type.
///
/// This function will attempt to interpret `bytes` as UTF-8 data and then
-/// deserialize `T` from the TOML document provided.
+/// deserialize `T` from the MILF document provided.
pub fn from_slice<'de, T>(bytes: &'de [u8]) -> Result<T, Error>
where
T: de::Deserialize<'de>,
@@ -41,7 +41,7 @@ where
/// Deserializes a string into a type.
///
-/// This function will attempt to interpret `s` as a TOML document and
+/// This function will attempt to interpret `s` as a MILF document and
/// deserialize `T` from the document.
///
/// # Examples
@@ -61,14 +61,14 @@ where
/// }
///
/// fn main() {
-/// let config: Config = toml::from_str(r#"
-/// title = 'TOML Example'
+/// let config: Config = milf::from_str(r#"
+/// title = 'MILF Example'
///
/// [owner]
/// name = 'Lisa'
/// "#).unwrap();
///
-/// assert_eq!(config.title, "TOML Example");
+/// assert_eq!(config.title, "MILF Example");
/// assert_eq!(config.owner.name, "Lisa");
/// }
/// ```
@@ -198,7 +198,7 @@ enum ErrorKind {
__Nonexhaustive,
}
-/// Deserialization implementation for TOML.
+/// Deserialization implementation for MILF.
pub struct Deserializer<'a> {
require_newline_after_table: bool,
allow_duplciate_after_longer_table: bool,
@@ -231,7 +231,7 @@ impl<'de, 'b> de::Deserializer<'de> for &'b mut Deserializer<'de> {
de: self,
});
res.map_err(|mut err| {
- // Errors originating from this library (toml), have an offset
+ // Errors originating from this library (milf), have an offset
// attached to them already. Other errors, like those originating
// from serde (like "missing field") or from a custom deserializer,
// do not have offsets on them. Here, we do a best guess at their
@@ -444,7 +444,7 @@ impl<'de, 'b> de::MapAccess<'de> for MapVisitor<'de, 'b> {
self.cur = pos;
// Test to see if we're duplicating our parent's table, and if so
- // then this is an error in the toml format
+ // then this is an error in the milf format
if self.cur_parent != pos {
if headers_equal(
&self.tables[self.cur_parent].header,
@@ -647,7 +647,7 @@ impl<'de, 'b> de::Deserializer<'de> for MapVisitor<'de, 'b> {
&& !(self.array && !self.values.peek().is_none())
{
// TODO we can't actually emit spans here for the *entire* table/array
- // due to the format that toml uses. Setting the start and end to 0 is
+ // due to the format that milf uses. Setting the start and end to 0 is
// *detectable* (and no reasonable span would look like that),
// it would be better to expose this in the API via proper
// ADTs like Option<T>.
@@ -1283,22 +1283,22 @@ impl<'a> Deserializer<'a> {
Ok(())
}
- /// Historical versions of toml-rs accidentally allowed a newline after a
- /// table definition, but the TOML spec requires a newline after a table
+ /// Historical versions of milf-rs accidentally allowed a newline after a
+ /// table definition, but the MILF spec requires a newline after a table
/// definition header.
///
/// This option can be set to `false` (the default is `true`) to emulate
- /// this behavior for backwards compatibility with older toml-rs versions.
+ /// this behavior for backwards compatibility with older milf-rs versions.
pub fn set_require_newline_after_table(&mut self, require: bool) {
self.require_newline_after_table = require;
}
- /// Historical versions of toml-rs accidentally allowed a duplicate table
+ /// Historical versions of milf-rs accidentally allowed a duplicate table
/// header after a longer table header was previously defined. This is
- /// invalid according to the TOML spec, however.
+ /// invalid according to the MILF spec, however.
///
/// This option can be set to `true` (the default is `false`) to emulate
- /// this behavior for backwards compatibility with older toml-rs versions.
+ /// this behavior for backwards compatibility with older milf-rs versions.
pub fn set_allow_duplicate_after_longer_table(&mut self, allow: bool) {
self.allow_duplciate_after_longer_table = allow;
}
@@ -2148,7 +2148,7 @@ impl fmt::Display for Error {
)?,
ErrorKind::UnquotedString => write!(
f,
- "invalid TOML value, did you mean to use a quoted string?"
+ "invalid MILF value, did you mean to use a quoted string?"
)?,
ErrorKind::__Nonexhaustive => panic!(),
}