1
Fork 0

Bless a few tests

This commit is contained in:
Deadbeef 2021-12-19 01:55:37 +08:00
parent 06a1c14d52
commit 3ae0dabddb
No known key found for this signature in database
GPG key ID: 6D017A96D8E6C2F9

View file

@ -3009,14 +3009,12 @@ impl<T, A: Allocator, const N: usize> TryFrom<Vec<T, A>> for [T; N] {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// use std::convert::TryInto;
/// assert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3])); /// assert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));
/// assert_eq!(<Vec<i32>>::new().try_into(), Ok([])); /// assert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
/// ``` /// ```
/// ///
/// If the length doesn't match, the input comes back in `Err`: /// 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(); /// 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])); /// assert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
/// ``` /// ```
@ -3024,7 +3022,6 @@ impl<T, A: Allocator, const N: usize> TryFrom<Vec<T, A>> for [T; N] {
/// If you're fine with just getting a prefix of the `Vec<T>`, /// If you're fine with just getting a prefix of the `Vec<T>`,
/// you can call [`.truncate(N)`](Vec::truncate) first. /// you can call [`.truncate(N)`](Vec::truncate) first.
/// ``` /// ```
/// use std::convert::TryInto;
/// let mut v = String::from("hello world").into_bytes(); /// let mut v = String::from("hello world").into_bytes();
/// v.sort(); /// v.sort();
/// v.truncate(2); /// v.truncate(2);