Skip to content

Commit 417e4b4

Browse files
author
Jorge Aparicio
committed
&mut [T] now implements Collection. Fixes #16896
1 parent c256454 commit 417e4b4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/libcore/slice.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -991,6 +991,15 @@ impl<'a, T> Collection for &'a [T] {
991991
}
992992
}
993993

994+
#[experimental = "trait is experimental"]
995+
impl<'a, T> Collection for &'a mut [T] {
996+
/// Returns the length of a vector
997+
#[inline]
998+
fn len(&self) -> uint {
999+
self.repr().len
1000+
}
1001+
}
1002+
9941003
#[unstable = "waiting for DST"]
9951004
impl<'a, T> Default for &'a [T] {
9961005
fn default() -> &'a [T] { &[] }

0 commit comments

Comments
 (0)