Skip to content

Commit a47eecd

Browse files
committed
Remove unnecessary import from doctests
1 parent 668ebf1 commit a47eecd

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

library/alloc/src/vec/mod.rs

-3
Original file line numberDiff line numberDiff line change
@@ -2696,22 +2696,19 @@ impl<T, A: Allocator, const N: usize> TryFrom<Vec<T, A>> for [T; N] {
26962696
/// # Examples
26972697
///
26982698
/// ```
2699-
/// use std::convert::TryInto;
27002699
/// assert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));
27012700
/// assert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
27022701
/// ```
27032702
///
27042703
/// If the length doesn't match, the input comes back in `Err`:
27052704
/// ```
2706-
/// use std::convert::TryInto;
27072705
/// let r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();
27082706
/// assert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
27092707
/// ```
27102708
///
27112709
/// If you're fine with just getting a prefix of the `Vec<T>`,
27122710
/// you can call [`.truncate(N)`](Vec::truncate) first.
27132711
/// ```
2714-
/// use std::convert::TryInto;
27152712
/// let mut v = String::from("hello world").into_bytes();
27162713
/// v.sort();
27172714
/// v.truncate(2);

0 commit comments

Comments
 (0)