Skip to content

Commit

Permalink
Implements Default for mutable slices. Fixes: #29244
Browse files Browse the repository at this point in the history
  • Loading branch information
James McGlashan committed Oct 23, 2015
1 parent 3f37f5a commit 36ce1c0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/libcore/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,11 @@ impl<'a, T> Default for &'a [T] {
fn default() -> &'a [T] { &[] }
}

#[stable(feature = "mut_slice_default", since = "1.5.0")]
impl<'a, T> Default for &'a mut [T] {
fn default() -> &'a mut [T] { &mut [] }
}

//
// Iterators
//
Expand Down

0 comments on commit 36ce1c0

Please sign in to comment.