Skip to content

Commit

Permalink
♻️ cleanup (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
punkstarman authored Feb 17, 2022
1 parent b0b8bc7 commit c4d55ff
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 20 deletions.
13 changes: 3 additions & 10 deletions src/de/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ mod var;
/// A convenience method for deserialize some object from a string.
///
/// ```rust
/// # #[macro_use]
/// # extern crate serde;
/// # extern crate serde_xml_rs;
/// # use serde::{Deserialize, Serialize};
/// # use serde_xml_rs::from_str;
/// #[derive(Debug, Deserialize, PartialEq)]
/// struct Item {
Expand All @@ -43,9 +41,7 @@ pub fn from_str<'de, T: de::Deserialize<'de>>(s: &str) -> Result<T> {
/// A convenience method for deserialize some object from a reader.
///
/// ```rust
/// # #[macro_use]
/// # extern crate serde;
/// # extern crate serde_xml_rs;
/// # use serde::Deserialize;
/// # use serde_xml_rs::from_reader;
/// #[derive(Debug, Deserialize, PartialEq)]
/// struct Item {
Expand Down Expand Up @@ -106,11 +102,8 @@ impl<'de, R: Read> RootDeserializer<R> {
/// default. Enabling this option may incur additional memory usage.
///
/// ```rust
/// # #[macro_use]
/// # extern crate serde;
/// # extern crate serde_xml_rs;
/// # use serde_xml_rs::from_reader;
/// # use serde::Deserialize;
/// # use serde_xml_rs::from_reader;
/// #[derive(Debug, Deserialize, PartialEq)]
/// struct Foo {
/// bar: Vec<usize>,
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
//! ## Tag contents
//!
//! ```rust
//! # use serde::{self, Deserialize, Serialize};
//! # use serde::{Deserialize, Serialize};
//! # use serde_xml_rs::{from_str, to_string};
//!
//! #[derive(Debug, Serialize, Deserialize, PartialEq)]
Expand All @@ -100,7 +100,7 @@
//! ## Repeated tags
//!
//! ```rust
//! # use serde::{self, Deserialize, Serialize};
//! # use serde::{Deserialize, Serialize};
//! # use serde_xml_rs::{from_str, to_string};
//!
//! #[derive(Debug, Serialize, Deserialize, PartialEq)]
Expand Down
8 changes: 2 additions & 6 deletions src/ser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ mod var;
/// # Examples
///
/// ```rust
/// # #[macro_use]
/// # extern crate serde;
/// # extern crate serde_xml_rs;
/// # use serde::Serialize;
/// # use serde_xml_rs::to_writer;
/// #[derive(Serialize)]
/// struct Person {
Expand Down Expand Up @@ -43,9 +41,7 @@ pub fn to_writer<W: Write, S: Serialize>(writer: W, value: &S) -> Result<()> {
/// # Examples
///
/// ```rust
/// # #[macro_use]
/// # extern crate serde;
/// # extern crate serde_xml_rs;
/// # use serde::Serialize;
/// # use serde_xml_rs::to_string;
/// #[derive(Serialize)]
/// struct Person {
Expand Down
4 changes: 2 additions & 2 deletions tests/migrated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -975,12 +975,12 @@ fn futile2() {
#[derive(Eq, PartialEq, Debug, Serialize, Deserialize)]
struct Object {
field: Option<Null>,
};
}

#[derive(Eq, PartialEq, Debug, Serialize, Deserialize)]
struct Stuff {
stuff_field: Option<Object>,
};
}

test_parse_ok(&[
(
Expand Down

0 comments on commit c4d55ff

Please sign in to comment.