Skip to content

Commit 159aebc

Browse files
committed
core: Whitespace policia
1 parent 45bcef7 commit 159aebc

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/libcore/ptr.rs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,19 @@ Function: memcpy
5959
Copies data from one src to dst that is not overlapping each other.
6060
Count is the number of elements to copy and not the number of bytes.
6161
*/
62-
unsafe fn memcpy<T>(dst: *T, src: *T, count: uint) { rusti::memcpy(dst, src, count); }
62+
unsafe fn memcpy<T>(dst: *T, src: *T, count: uint) {
63+
rusti::memcpy(dst, src, count);
64+
}
6365

6466
/*
6567
Function: memmove
6668
6769
Copies data from one src to dst, overlap between the two pointers may occur.
6870
Count is the number of elements to copy and not the number of bytes.
6971
*/
70-
unsafe fn memmove<T>(dst: *T, src: *T, count: uint) { rusti::memcpy(dst, src, count); }
72+
unsafe fn memmove<T>(dst: *T, src: *T, count: uint) {
73+
rusti::memcpy(dst, src, count);
74+
}
7175

7276
#[test]
7377
fn test() unsafe {
@@ -87,11 +91,14 @@ fn test() unsafe {
8791

8892
let v0 = [32000u16, 32001u16, 32002u16];
8993
let v1 = [0u16, 0u16, 0u16];
90-
91-
ptr::memcpy(ptr::offset(vec::unsafe::to_ptr(v1), 1u), ptr::offset(vec::unsafe::to_ptr(v0), 1u), 1u);
94+
95+
ptr::memcpy(ptr::offset(vec::unsafe::to_ptr(v1), 1u),
96+
ptr::offset(vec::unsafe::to_ptr(v0), 1u), 1u);
9297
assert (v1[0] == 0u16 && v1[1] == 32001u16 && v1[2] == 0u16);
93-
ptr::memcpy(vec::unsafe::to_ptr(v1), ptr::offset(vec::unsafe::to_ptr(v0), 2u), 1u);
98+
ptr::memcpy(vec::unsafe::to_ptr(v1),
99+
ptr::offset(vec::unsafe::to_ptr(v0), 2u), 1u);
94100
assert (v1[0] == 32002u16 && v1[1] == 32001u16 && v1[2] == 0u16);
95-
ptr::memcpy(ptr::offset(vec::unsafe::to_ptr(v1), 2u), vec::unsafe::to_ptr(v0), 1u);
101+
ptr::memcpy(ptr::offset(vec::unsafe::to_ptr(v1), 2u),
102+
vec::unsafe::to_ptr(v0), 1u);
96103
assert (v1[0] == 32002u16 && v1[1] == 32001u16 && v1[2] == 32000u16);
97104
}

0 commit comments

Comments
 (0)