]> git.lizzy.rs Git - rust.git/commitdiff
Bless a few tests
authorDeadbeef <ent3rm4n@gmail.com>
Sat, 18 Dec 2021 17:55:37 +0000 (01:55 +0800)
committerDeadbeef <ent3rm4n@gmail.com>
Thu, 23 Dec 2021 13:26:05 +0000 (21:26 +0800)
library/alloc/src/vec/mod.rs

index 16df293108017a3778285108c13c2b444c0931e8..768374bd7816fe1f01018b7fe1e36a84ebe6293f 100644 (file)
@@ -3009,14 +3009,12 @@ fn from(s: &str) -> Vec<u8> {
     /// # Examples
     ///
     /// ```
-    /// use std::convert::TryInto;
     /// assert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));
     /// assert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
     /// ```
     ///
     /// If the length doesn't match, the input comes back in `Err`:
     /// ```
-    /// use std::convert::TryInto;
     /// let r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();
     /// assert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
     /// ```
@@ -3024,7 +3022,6 @@ fn from(s: &str) -> Vec<u8> {
     /// If you're fine with just getting a prefix of the `Vec<T>`,
     /// you can call [`.truncate(N)`](Vec::truncate) first.
     /// ```
-    /// use std::convert::TryInto;
     /// let mut v = String::from("hello world").into_bytes();
     /// v.sort();
     /// v.truncate(2);