diff options
| author | JeremyLetang <letang.jeremy@gmail.com> | 2014-02-10 16:50:42 -0500 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-02-13 12:54:17 -0800 |
| commit | 60bc76fb78d226078a901efd94f61463c0d93b9a (patch) | |
| tree | 8c8777c148f24c82d45728e9817cd9a8b4de223d /src/libstd/io | |
| parent | 1c5295c0bf6e69a772120ec6a56e0fdb3021ded4 (diff) | |
| download | rust-60bc76fb78d226078a901efd94f61463c0d93b9a.tar.gz rust-60bc76fb78d226078a901efd94f61463c0d93b9a.zip | |
remove duplicate function from std::ptr (is_null, is_not_null, offset, mut_offset)
Diffstat (limited to 'src/libstd/io')
| -rw-r--r-- | src/libstd/io/extensions.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libstd/io/extensions.rs b/src/libstd/io/extensions.rs index 240f4c65501..da4697d0e48 100644 --- a/src/libstd/io/extensions.rs +++ b/src/libstd/io/extensions.rs @@ -18,6 +18,7 @@ use iter::Iterator; use option::Option; use io::Reader; use vec::{OwnedVector, ImmutableVector}; +use ptr::RawPtr; /// An iterator that reads a single byte on each iteration, /// until `.read_byte()` returns `None`. @@ -104,7 +105,7 @@ pub fn u64_from_be_bytes(data: &[u8], start: uint, size: uint) -> u64 { - use ptr::{copy_nonoverlapping_memory, offset, mut_offset}; + use ptr::{copy_nonoverlapping_memory}; use mem::from_be64; use vec::MutableVector; @@ -116,9 +117,9 @@ pub fn u64_from_be_bytes(data: &[u8], let mut buf = [0u8, ..8]; unsafe { - let ptr = offset(data.as_ptr(), start as int); + let ptr = data.as_ptr().offset(start as int); let out = buf.as_mut_ptr(); - copy_nonoverlapping_memory(mut_offset(out, (8 - size) as int), ptr, size); + copy_nonoverlapping_memory(out.offset((8 - size) as int), ptr, size); from_be64(*(out as *i64)) as u64 } } |
