Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
Remove ```edition2018 from doc tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Oct 4, 2019
1 parent b7ff08f commit 96385b7
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 76 deletions.
2 changes: 1 addition & 1 deletion src/error.rs
Expand Up @@ -83,7 +83,7 @@ impl Error {
///
/// # Examples
///
/// ```edition2018
/// ```
/// # use serde_yaml::{Value, Error};
/// #
/// // The `@` character as the first character makes this invalid yaml
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Expand Up @@ -10,7 +10,7 @@
//!
//! # Examples
//!
//! ```edition2018
//! ```
//! use std::collections::BTreeMap;
//!
//! fn main() -> Result<(), serde_yaml::Error> {
Expand All @@ -35,7 +35,7 @@
//! It can also be used with Serde's serialization code generator `serde_derive` to
//! handle structs and enums defined in your own program.
//!
//! ```edition2018
//! ```
//! # use serde_derive::{Serialize, Deserialize};
//! use serde::{Serialize, Deserialize};
//!
Expand Down
20 changes: 10 additions & 10 deletions src/number.rs
Expand Up @@ -31,7 +31,7 @@ impl Number {
/// For any Number on which `is_i64` returns true, `as_i64` is guaranteed to
/// return the integer value.
///
/// ```edition2018
/// ```
/// # use std::i64;
/// #
/// # fn yaml(i: &str) -> serde_yaml::Value { serde_yaml::from_str(i).unwrap() }
Expand Down Expand Up @@ -66,7 +66,7 @@ impl Number {
/// For any Number on which `is_u64` returns true, `as_u64` is guaranteed to
/// return the integer value.
///
/// ```edition2018
/// ```
/// # fn yaml(i: &str) -> serde_yaml::Value { serde_yaml::from_str(i).unwrap() }
/// #
/// let v = yaml(r#"
Expand Down Expand Up @@ -99,7 +99,7 @@ impl Number {
/// Currently this function returns true if and only if both `is_i64` and
/// `is_u64` return false but this is not a guarantee in the future.
///
/// ```edition2018
/// ```
/// # fn yaml(i: &str) -> serde_yaml::Value { serde_yaml::from_str(i).unwrap() }
/// #
/// let v = yaml(r#"
Expand All @@ -126,7 +126,7 @@ impl Number {
/// If the `Number` is an integer, represent it as i64 if possible. Returns
/// None otherwise.
///
/// ```edition2018
/// ```
/// # use std::i64;
/// #
/// # fn yaml(i: &str) -> serde_yaml::Value { serde_yaml::from_str(i).unwrap() }
Expand Down Expand Up @@ -161,7 +161,7 @@ impl Number {
/// If the `Number` is an integer, represent it as u64 if possible. Returns
/// None otherwise.
///
/// ```edition2018
/// ```
/// # fn yaml(i: &str) -> serde_yaml::Value { serde_yaml::from_str(i).unwrap() }
/// #
/// let v = yaml(r#"
Expand All @@ -185,7 +185,7 @@ impl Number {

/// Represents the number as f64 if possible. Returns None otherwise.
///
/// ```edition2018
/// ```
/// #
/// # fn yaml(i: &str) -> serde_yaml::Value { serde_yaml::from_str(i).unwrap() }
/// let v = yaml(r#"
Expand All @@ -200,7 +200,7 @@ impl Number {
/// assert_eq!(v["c"].as_f64(), Some(-64.0));
/// ```
///
/// ```edition2018
/// ```
/// # use std::f64;
/// # fn yaml(i: &str) -> serde_yaml::Value { serde_yaml::from_str(i).unwrap() }
/// assert_eq!(yaml("inf").as_f64(), Some(f64::INFINITY));
Expand All @@ -218,7 +218,7 @@ impl Number {

/// Returns true if this value is NaN and false otherwise.
///
/// ```edition2018
/// ```
/// # use std::f64;
/// #
/// # use serde_yaml::Number;
Expand All @@ -244,7 +244,7 @@ impl Number {
/// Returns true if this value is positive infinity or negative infinity and
/// false otherwise.
///
/// ```edition2018
/// ```
/// # use std::f64;
/// #
/// # use serde_yaml::Number;
Expand All @@ -269,7 +269,7 @@ impl Number {

/// Returns true if this number is neither infinite nor NaN.
///
/// ```edition2018
/// ```
/// # use std::f64;
/// #
/// # use serde_yaml::Number;
Expand Down
22 changes: 11 additions & 11 deletions src/value/from.rs
Expand Up @@ -26,7 +26,7 @@ impl From<bool> for Value {
///
/// # Examples
///
/// ```edition2018
/// ```
/// use serde_yaml::Value;
///
/// let b = false;
Expand All @@ -42,7 +42,7 @@ impl From<String> for Value {
///
/// # Examples
///
/// ```edition2018
/// ```
/// use serde_yaml::Value;
///
/// let s: String = "lorem".to_string();
Expand All @@ -58,7 +58,7 @@ impl<'a> From<&'a str> for Value {
///
/// # Examples
///
/// ```edition2018
/// ```
/// use serde_yaml::Value;
///
/// let s: &str = "lorem";
Expand All @@ -76,15 +76,15 @@ impl<'a> From<Cow<'a, str>> for Value {
///
/// # Examples
///
/// ```edition2018
/// ```
/// use serde_yaml::Value;
/// use std::borrow::Cow;
///
/// let s: Cow<str> = Cow::Borrowed("lorem");
/// let x: Value = s.into();
/// ```
///
/// ```edition2018
/// ```
/// use serde_yaml::Value;
/// use std::borrow::Cow;
///
Expand All @@ -101,7 +101,7 @@ impl From<Mapping> for Value {
///
/// # Examples
///
/// ```edition2018
/// ```
/// use serde_yaml::{Mapping, Value};
///
/// let mut m = Mapping::new();
Expand All @@ -118,7 +118,7 @@ impl<T: Into<Value>> From<Vec<T>> for Value {
///
/// # Examples
///
/// ```edition2018
/// ```
/// use serde_yaml::Value;
///
/// let v = vec!["lorem", "ipsum", "dolor"];
Expand All @@ -134,7 +134,7 @@ impl<'a, T: Clone + Into<Value>> From<&'a [T]> for Value {
///
/// # Examples
///
/// ```edition2018
/// ```
/// use serde_yaml::Value;
///
/// let v: &[&str] = &["lorem", "ipsum", "dolor"];
Expand All @@ -152,21 +152,21 @@ impl<T: Into<Value>> FromIterator<T> for Value {
///
/// # Examples
///
/// ```edition2018
/// ```
/// use serde_yaml::Value;
///
/// let v = std::iter::repeat(42).take(5);
/// let x: Value = v.collect();
/// ```
///
/// ```edition2018
/// ```
/// use serde_yaml::Value;
///
/// let v: Vec<_> = vec!["lorem", "ipsum", "dolor"];
/// let x: Value = v.into_iter().collect();
/// ```
///
/// ```edition2018
/// ```
/// use std::iter::FromIterator;
/// use serde_yaml::Value;
///
Expand Down
4 changes: 2 additions & 2 deletions src/value/index.rs
Expand Up @@ -200,7 +200,7 @@ where
///
/// # Examples
///
/// ```edition2018
/// ```
/// # fn yaml(i: &str) -> serde_yaml::Value { serde_yaml::from_str(i).unwrap() }
/// #
/// let data = yaml(r#"{ x: { y: [z, zz] } }"#);
Expand Down Expand Up @@ -235,7 +235,7 @@ where
///
/// # Examples
///
/// ```edition2018
/// ```
/// # fn yaml(i: &str) -> serde_yaml::Value { serde_yaml::from_str(i).unwrap() }
/// #
/// let mut data = yaml(r#"{x: 0}"#);
Expand Down

0 comments on commit 96385b7

Please sign in to comment.