&mut [T] now implements Collection. Fixes #16896

This commit is contained in:
Jorge Aparicio 2014-08-31 02:09:46 -05:00
parent c2564540de
commit 417e4b41bb
1 changed files with 9 additions and 0 deletions

View File

@ -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] { &[] }