mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
Fix documentation of Rc as From<Vec<T>>
This commit is contained in:
parent
fb31b3c34e
commit
f1fc871ce6
@ -2491,9 +2491,9 @@ impl<T, A: Allocator> From<Vec<T, A>> for Rc<[T], A> {
|
||||
///
|
||||
/// ```
|
||||
/// # use std::rc::Rc;
|
||||
/// let original: Box<Vec<i32>> = Box::new(vec![1, 2, 3]);
|
||||
/// let shared: Rc<Vec<i32>> = Rc::from(original);
|
||||
/// assert_eq!(vec![1, 2, 3], *shared);
|
||||
/// let unique: Vec<i32> = vec![1, 2, 3];
|
||||
/// let shared: Rc<[i32]> = Rc::from(unique);
|
||||
/// assert_eq!(&[1, 2, 3], &shared[..]);
|
||||
/// ```
|
||||
#[inline]
|
||||
fn from(v: Vec<T, A>) -> Rc<[T], A> {
|
||||
|
Loading…
Reference in New Issue
Block a user