Borrow Vec<T, A> as [T]

This commit is contained in:
yanchith 2022-07-16 11:58:26 +02:00
parent e6c43cf8b9
commit aeb949753e

View File

@ -836,14 +836,14 @@ fn join(slice: &Self, sep: &[T]) -> Vec<T> {
////////////////////////////////////////////////////////////////////////////////
#[stable(feature = "rust1", since = "1.0.0")]
impl<T> Borrow<[T]> for Vec<T> {
impl<T, A: Allocator> Borrow<[T]> for Vec<T, A> {
fn borrow(&self) -> &[T] {
&self[..]
}
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<T> BorrowMut<[T]> for Vec<T> {
impl<T, A: Allocator> BorrowMut<[T]> for Vec<T, A> {
fn borrow_mut(&mut self) -> &mut [T] {
&mut self[..]
}