Skip to content

Commit

Permalink
Fixed out of date comment on copy_memory
Browse files Browse the repository at this point in the history
  • Loading branch information
Clark Gaebel committed Dec 3, 2014
1 parent 3a325c6 commit 851c7b5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/libcore/slice.rs
Expand Up @@ -1781,12 +1781,13 @@ pub mod bytes {

/// Copies data from `src` to `dst`
///
/// `src` and `dst` must not overlap. Panics if the length of `dst`
/// is less than the length of `src`.
/// Panics if the length of `dst` is less than the length of `src`.
#[inline]
pub fn copy_memory(dst: &mut [u8], src: &[u8]) {
let len_src = src.len();
assert!(dst.len() >= len_src);
// `dst` is unaliasable, so we know statically it doesn't overlap
// with `src`.
unsafe {
ptr::copy_nonoverlapping_memory(dst.as_mut_ptr(),
src.as_ptr(),
Expand Down

0 comments on commit 851c7b5

Please sign in to comment.