diff options
| author | Deadbeef <ent3rm4n@gmail.com> | 2021-12-17 21:53:28 +0800 |
|---|---|---|
| committer | Deadbeef <ent3rm4n@gmail.com> | 2021-12-23 19:03:47 +0800 |
| commit | 06a1c14d52a8482a33416c21b320970cab80cccc (patch) | |
| tree | c65ae1e5cf06d9bf4ec6d9db91427e39a65acdda /library/core/src | |
| parent | f52eb4ca8b21371f435a1941e05af749a5894df1 (diff) | |
Switch all libraries to the 2021 edition
Diffstat (limited to 'library/core/src')
| -rw-r--r-- | library/core/src/array/mod.rs | 2 | ||||
| -rw-r--r-- | library/core/src/convert/mod.rs | 4 | ||||
| -rw-r--r-- | library/core/src/iter/traits/collect.rs | 6 | ||||
| -rw-r--r-- | library/core/src/iter/traits/iterator.rs | 4 | ||||
| -rw-r--r-- | library/core/src/num/int_macros.rs | 6 | ||||
| -rw-r--r-- | library/core/src/num/uint_macros.rs | 6 |
6 files changed, 0 insertions, 28 deletions
diff --git a/library/core/src/array/mod.rs b/library/core/src/array/mod.rs index 37292bf8e26..121aa634deb 100644 --- a/library/core/src/array/mod.rs +++ b/library/core/src/array/mod.rs @@ -66,8 +66,6 @@ where /// /// ```rust /// #![feature(array_from_fn)] -/// # // Apparently these doc tests are still on edition2018 -/// # use std::convert::TryInto; /// /// let array: Result<[u8; 5], _> = std::array::try_from_fn(|i| i.try_into()); /// assert_eq!(array, Ok([0, 1, 2, 3, 4])); diff --git a/library/core/src/convert/mod.rs b/library/core/src/convert/mod.rs index 1c2e673d604..d40f69f8b35 100644 --- a/library/core/src/convert/mod.rs +++ b/library/core/src/convert/mod.rs @@ -426,8 +426,6 @@ pub trait TryInto<T>: Sized { /// `TryFrom<T>` can be implemented as follows: /// /// ``` -/// use std::convert::TryFrom; -/// /// struct GreaterThanZero(i32); /// /// impl TryFrom<i32> for GreaterThanZero { @@ -448,8 +446,6 @@ pub trait TryInto<T>: Sized { /// As described, [`i32`] implements `TryFrom<`[`i64`]`>`: /// /// ``` -/// use std::convert::TryFrom; -/// /// let big_number = 1_000_000_000_000i64; /// // Silently truncates `big_number`, requires detecting /// // and handling the truncation after the fact. diff --git a/library/core/src/iter/traits/collect.rs b/library/core/src/iter/traits/collect.rs index 56fad602cf9..26c97b8ed78 100644 --- a/library/core/src/iter/traits/collect.rs +++ b/library/core/src/iter/traits/collect.rs @@ -15,8 +15,6 @@ /// Basic usage: /// /// ``` -/// use std::iter::FromIterator; -/// /// let five_fives = std::iter::repeat(5).take(5); /// /// let v = Vec::from_iter(five_fives); @@ -37,8 +35,6 @@ /// Implementing `FromIterator` for your type: /// /// ``` -/// use std::iter::FromIterator; -/// /// // A sample collection, that's just a wrapper over Vec<T> /// #[derive(Debug)] /// struct MyCollection(Vec<i32>); @@ -102,8 +98,6 @@ pub trait FromIterator<A>: Sized { /// Basic usage: /// /// ``` - /// use std::iter::FromIterator; - /// /// let five_fives = std::iter::repeat(5).take(5); /// /// let v = Vec::from_iter(five_fives); diff --git a/library/core/src/iter/traits/iterator.rs b/library/core/src/iter/traits/iterator.rs index 9a9a844f41b..2049adafa2f 100644 --- a/library/core/src/iter/traits/iterator.rs +++ b/library/core/src/iter/traits/iterator.rs @@ -1155,8 +1155,6 @@ pub trait Iterator { /// Stopping after an initial [`None`]: /// /// ``` - /// use std::convert::TryFrom; - /// /// let a = [0, 1, 2, -3, 4, 5, -6]; /// /// let iter = a.iter().map_while(|x| u32::try_from(*x).ok()); @@ -1172,8 +1170,6 @@ pub trait Iterator { /// removed: /// /// ``` - /// use std::convert::TryFrom; - /// /// let a = [1, 2, -3, 4]; /// let mut iter = a.iter(); /// diff --git a/library/core/src/num/int_macros.rs b/library/core/src/num/int_macros.rs index e6ae4afd7c1..6f7c5a6d119 100644 --- a/library/core/src/num/int_macros.rs +++ b/library/core/src/num/int_macros.rs @@ -2602,8 +2602,6 @@ macro_rules! int_impl { /// When starting from a slice rather than an array, fallible conversion APIs can be used: /// /// ``` - /// use std::convert::TryInto; - /// #[doc = concat!("fn read_be_", stringify!($SelfT), "(input: &mut &[u8]) -> ", stringify!($SelfT), " {")] #[doc = concat!(" let (int_bytes, rest) = input.split_at(std::mem::size_of::<", stringify!($SelfT), ">());")] /// *input = rest; @@ -2633,8 +2631,6 @@ macro_rules! int_impl { /// When starting from a slice rather than an array, fallible conversion APIs can be used: /// /// ``` - /// use std::convert::TryInto; - /// #[doc = concat!("fn read_le_", stringify!($SelfT), "(input: &mut &[u8]) -> ", stringify!($SelfT), " {")] #[doc = concat!(" let (int_bytes, rest) = input.split_at(std::mem::size_of::<", stringify!($SelfT), ">());")] /// *input = rest; @@ -2675,8 +2671,6 @@ macro_rules! int_impl { /// When starting from a slice rather than an array, fallible conversion APIs can be used: /// /// ``` - /// use std::convert::TryInto; - /// #[doc = concat!("fn read_ne_", stringify!($SelfT), "(input: &mut &[u8]) -> ", stringify!($SelfT), " {")] #[doc = concat!(" let (int_bytes, rest) = input.split_at(std::mem::size_of::<", stringify!($SelfT), ">());")] /// *input = rest; diff --git a/library/core/src/num/uint_macros.rs b/library/core/src/num/uint_macros.rs index 3cc454baf35..1dd8b0a18ab 100644 --- a/library/core/src/num/uint_macros.rs +++ b/library/core/src/num/uint_macros.rs @@ -2323,8 +2323,6 @@ macro_rules! uint_impl { /// When starting from a slice rather than an array, fallible conversion APIs can be used: /// /// ``` - /// use std::convert::TryInto; - /// #[doc = concat!("fn read_be_", stringify!($SelfT), "(input: &mut &[u8]) -> ", stringify!($SelfT), " {")] #[doc = concat!(" let (int_bytes, rest) = input.split_at(std::mem::size_of::<", stringify!($SelfT), ">());")] /// *input = rest; @@ -2354,8 +2352,6 @@ macro_rules! uint_impl { /// When starting from a slice rather than an array, fallible conversion APIs can be used: /// /// ``` - /// use std::convert::TryInto; - /// #[doc = concat!("fn read_le_", stringify!($SelfT), "(input: &mut &[u8]) -> ", stringify!($SelfT), " {")] #[doc = concat!(" let (int_bytes, rest) = input.split_at(std::mem::size_of::<", stringify!($SelfT), ">());")] /// *input = rest; @@ -2396,8 +2392,6 @@ macro_rules! uint_impl { /// When starting from a slice rather than an array, fallible conversion APIs can be used: /// /// ``` - /// use std::convert::TryInto; - /// #[doc = concat!("fn read_ne_", stringify!($SelfT), "(input: &mut &[u8]) -> ", stringify!($SelfT), " {")] #[doc = concat!(" let (int_bytes, rest) = input.split_at(std::mem::size_of::<", stringify!($SelfT), ">());")] /// *input = rest; |
