diff options
| author | Brian Anderson <banderson@mozilla.com> | 2014-08-06 20:17:03 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2014-08-13 11:30:15 -0700 |
| commit | c9abc01a985a7634b8fc73d9862ecea6181c3c11 (patch) | |
| tree | 9d0b0c07cfb806b2703fb03bc93dca60814d3bb1 | |
| parent | d4c736b1f0bd76fc083f1710f16f07e0e15fe6a0 (diff) | |
| download | rust-c9abc01a985a7634b8fc73d9862ecea6181c3c11.tar.gz rust-c9abc01a985a7634b8fc73d9862ecea6181c3c11.zip | |
core: Rename MutableCloneableSlice::copy_from to clone_from_slice
Deprecate the previous.
| -rw-r--r-- | src/libcore/slice.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libcore/slice.rs b/src/libcore/slice.rs index 0eb97241307..b914a26d94c 100644 --- a/src/libcore/slice.rs +++ b/src/libcore/slice.rs @@ -840,6 +840,12 @@ pub trait MutableCloneableSlice<T> { /// Copies as many elements from `src` as it can into `self` (the /// shorter of `self.len()` and `src.len()`). Returns the number /// of elements copied. + #[deprecated = "renamed to clone_from_slice"] + fn copy_from(self, s: &[T]) -> uint { self.clone_from_slice(s) } + + /// Copies as many elements from `src` as it can into `self` (the + /// shorter of `self.len()` and `src.len()`). Returns the number + /// of elements copied. /// /// # Example /// @@ -856,12 +862,12 @@ pub trait MutableCloneableSlice<T> { /// assert!(dst.copy_from(src2) == 3); /// assert!(dst == [3i, 4, 5]); /// ``` - fn copy_from(self, &[T]) -> uint; + fn clone_from_slice(self, &[T]) -> uint; } impl<'a, T:Clone> MutableCloneableSlice<T> for &'a mut [T] { #[inline] - fn copy_from(self, src: &[T]) -> uint { + fn clone_from_slice(self, src: &[T]) -> uint { for (a, b) in self.mut_iter().zip(src.iter()) { a.clone_from(b); } |
