&mut [T] now implements Collection. Fixes #16896
This commit is contained in:
parent
c2564540de
commit
417e4b41bb
@ -991,6 +991,15 @@ impl<'a, T> Collection for &'a [T] {
|
||||
}
|
||||
}
|
||||
|
||||
#[experimental = "trait is experimental"]
|
||||
impl<'a, T> Collection for &'a mut [T] {
|
||||
/// Returns the length of a vector
|
||||
#[inline]
|
||||
fn len(&self) -> uint {
|
||||
self.repr().len
|
||||
}
|
||||
}
|
||||
|
||||
#[unstable = "waiting for DST"]
|
||||
impl<'a, T> Default for &'a [T] {
|
||||
fn default() -> &'a [T] { &[] }
|
||||
|
Loading…
Reference in New Issue
Block a user