about summary refs log tree commit diff
path: root/src/librbml/lib.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-03-27 11:12:28 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-03-30 14:08:40 -0700
commitacd48a2b3e7fcc0372f7718a2fac1cf80e03db95 (patch)
treebf57c82936ee2c1e1df23edd0a750ec6aa75021d /src/librbml/lib.rs
parent14192d6df5cc714e5c9a3ca70b08f2514d977be2 (diff)
downloadrust-acd48a2b3e7fcc0372f7718a2fac1cf80e03db95.tar.gz
rust-acd48a2b3e7fcc0372f7718a2fac1cf80e03db95.zip
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]
Diffstat (limited to 'src/librbml/lib.rs')
-rw-r--r--src/librbml/lib.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/librbml/lib.rs b/src/librbml/lib.rs
index 234b8cf5eb5..80341fa1a7a 100644
--- a/src/librbml/lib.rs
+++ b/src/librbml/lib.rs
@@ -449,21 +449,21 @@ pub mod reader {
     pub fn doc_as_u16(d: Doc) -> u16 {
         assert_eq!(d.end, d.start + 2);
         let mut b = [0; 2];
-        bytes::copy_memory(&mut b, &d.data[d.start..d.end]);
+        bytes::copy_memory(&d.data[d.start..d.end], &mut b);
         unsafe { (*(b.as_ptr() as *const u16)).to_be() }
     }
 
     pub fn doc_as_u32(d: Doc) -> u32 {
         assert_eq!(d.end, d.start + 4);
         let mut b = [0; 4];
-        bytes::copy_memory(&mut b, &d.data[d.start..d.end]);
+        bytes::copy_memory(&d.data[d.start..d.end], &mut b);
         unsafe { (*(b.as_ptr() as *const u32)).to_be() }
     }
 
     pub fn doc_as_u64(d: Doc) -> u64 {
         assert_eq!(d.end, d.start + 8);
         let mut b = [0; 8];
-        bytes::copy_memory(&mut b, &d.data[d.start..d.end]);
+        bytes::copy_memory(&d.data[d.start..d.end], &mut b);
         unsafe { (*(b.as_ptr() as *const u64)).to_be() }
     }
 
@@ -938,7 +938,7 @@ pub mod writer {
                 {
                     let last_size_pos = last_size_pos as usize;
                     let data = &self.writer.get_ref()[last_size_pos+4..cur_pos as usize];
-                    bytes::copy_memory(&mut buf, data);
+                    bytes::copy_memory(data, &mut buf);
                 }
 
                 // overwrite the size and data and continue