Skip to content

Commit

Permalink
Code review: remove 2nd example
Browse files Browse the repository at this point in the history
  • Loading branch information
SomeoneToIgnore committed Apr 14, 2023
1 parent 147a04c commit ca934c8
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions crates/toml_edit/src/de/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use crate::de::Error;
/// # Example
///
/// ```
/// use serde::de::IntoDeserializer;
/// use serde::Deserialize;
///
/// #[derive(Deserialize)]
Expand All @@ -25,20 +24,11 @@ use crate::de::Error;
/// name: String,
/// }
///
/// let toml_str = r#"{ title = 'TOML Example', owner = { name = 'Lisa' } }"#;
///
/// let deserializer = toml_str
/// .parse::<toml_edit::de::ValueDeserializer>()
/// .unwrap();
/// let value = r#"{ title = 'TOML Example', owner = { name = 'Lisa' } }"#;
/// let deserializer = value.parse::<toml_edit::de::ValueDeserializer>().unwrap();
/// let config = Config::deserialize(deserializer).unwrap();
/// assert_eq!(config.title, "TOML Example");
/// assert_eq!(config.owner.name, "Lisa");
///
/// let toml_item: toml_edit::Item = toml_str.parse().unwrap();
/// let another_deserializer = toml_item.into_value().unwrap().into_deserializer();
/// let another_config = Config::deserialize(another_deserializer).unwrap();
/// assert_eq!(another_config.title, "TOML Example");
/// assert_eq!(another_config.owner.name, "Lisa");
/// ```
pub struct ValueDeserializer {
input: crate::Item,
Expand Down

0 comments on commit ca934c8

Please sign in to comment.