std: Standardize (input, output) param orderings

This functions swaps the order of arguments to a few functions that previously
took (output, input) parameters, but now take (input, output) parameters (in
that order).

The affected functions are:

* ptr::copy
* ptr::copy_nonoverlapping
* slice::bytes::copy_memory
* intrinsics::copy
* intrinsics::copy_nonoverlapping

Closes #22890
[breaking-change]
This commit is contained in:
Alex Crichton
2015-03-27 11:12:28 -07:00
parent 14192d6df5
commit acd48a2b3e
29 changed files with 147 additions and 107 deletions

View File

@@ -151,7 +151,7 @@ impl Write for Cursor<Vec<u8>> {
// there (left), and what will be appended on the end (right)
let space = self.inner.len() - pos as usize;
let (left, right) = buf.split_at(cmp::min(space, buf.len()));
slice::bytes::copy_memory(&mut self.inner[(pos as usize)..], left);
slice::bytes::copy_memory(left, &mut self.inner[(pos as usize)..]);
self.inner.push_all(right);
// Bump us forward