about summary refs log tree commit diff
path: root/src/libstd/io
diff options
context:
space:
mode:
authorChris Wong <lambda.fairy@gmail.com>2014-01-25 20:37:51 +1300
committerChris Wong <lambda.fairy@gmail.com>2014-01-25 21:38:25 +1300
commit988e4f0a1c2802921375271bdc19f03650c024d2 (patch)
treeb2d2913ca7575e8e52f2cf6e7975ca2f0f148286 /src/libstd/io
parentde57a22b9a8c8416cace31c9bd3ec4c9a6888017 (diff)
downloadrust-988e4f0a1c2802921375271bdc19f03650c024d2.tar.gz
rust-988e4f0a1c2802921375271bdc19f03650c024d2.zip
Uppercase numeric constants
The following are renamed:

* `min_value` => `MIN`
* `max_value` => `MAX`
* `bits` => `BITS`
* `bytes` => `BYTES`

Fixes #10010.
Diffstat (limited to 'src/libstd/io')
-rw-r--r--src/libstd/io/extensions.rs8
-rw-r--r--src/libstd/io/mod.rs18
2 files changed, 13 insertions, 13 deletions
diff --git a/src/libstd/io/extensions.rs b/src/libstd/io/extensions.rs
index e58fcc16182..6a9da944f8b 100644
--- a/src/libstd/io/extensions.rs
+++ b/src/libstd/io/extensions.rs
@@ -1,4 +1,4 @@
-// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
 //
@@ -401,7 +401,7 @@ mod test {
 
     #[test]
     fn test_read_write_le_mem() {
-        let uints = [0, 1, 2, 42, 10_123, 100_123_456, ::u64::max_value];
+        let uints = [0, 1, 2, 42, 10_123, 100_123_456, ::u64::MAX];
 
         let mut writer = MemWriter::new();
         for i in uints.iter() {
@@ -417,7 +417,7 @@ mod test {
 
     #[test]
     fn test_read_write_be() {
-        let uints = [0, 1, 2, 42, 10_123, 100_123_456, ::u64::max_value];
+        let uints = [0, 1, 2, 42, 10_123, 100_123_456, ::u64::MAX];
 
         let mut writer = MemWriter::new();
         for i in uints.iter() {
@@ -432,7 +432,7 @@ mod test {
 
     #[test]
     fn test_read_be_int_n() {
-        let ints = [::i32::min_value, -123456, -42, -5, 0, 1, ::i32::max_value];
+        let ints = [::i32::MIN, -123456, -42, -5, 0, 1, ::i32::MAX];
 
         let mut writer = MemWriter::new();
         for i in ints.iter() {
diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs
index 30827983360..027c4f18344 100644
--- a/src/libstd/io/mod.rs
+++ b/src/libstd/io/mod.rs
@@ -1,4 +1,4 @@
-// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
 //
@@ -680,28 +680,28 @@ pub trait Reader {
     ///
     /// The number of bytes returned is system-dependant.
     fn read_le_uint(&mut self) -> uint {
-        self.read_le_uint_n(uint::bytes) as uint
+        self.read_le_uint_n(uint::BYTES) as uint
     }
 
     /// Reads a little-endian integer.
     ///
     /// The number of bytes returned is system-dependant.
     fn read_le_int(&mut self) -> int {
-        self.read_le_int_n(int::bytes) as int
+        self.read_le_int_n(int::BYTES) as int
     }
 
     /// Reads a big-endian unsigned integer.
     ///
     /// The number of bytes returned is system-dependant.
     fn read_be_uint(&mut self) -> uint {
-        self.read_be_uint_n(uint::bytes) as uint
+        self.read_be_uint_n(uint::BYTES) as uint
     }
 
     /// Reads a big-endian integer.
     ///
     /// The number of bytes returned is system-dependant.
     fn read_be_int(&mut self) -> int {
-        self.read_be_int_n(int::bytes) as int
+        self.read_be_int_n(int::BYTES) as int
     }
 
     /// Reads a big-endian `u64`.
@@ -915,22 +915,22 @@ pub trait Writer {
 
     /// Write a little-endian uint (number of bytes depends on system).
     fn write_le_uint(&mut self, n: uint) {
-        extensions::u64_to_le_bytes(n as u64, uint::bytes, |v| self.write(v))
+        extensions::u64_to_le_bytes(n as u64, uint::BYTES, |v| self.write(v))
     }
 
     /// Write a little-endian int (number of bytes depends on system).
     fn write_le_int(&mut self, n: int) {
-        extensions::u64_to_le_bytes(n as u64, int::bytes, |v| self.write(v))
+        extensions::u64_to_le_bytes(n as u64, int::BYTES, |v| self.write(v))
     }
 
     /// Write a big-endian uint (number of bytes depends on system).
     fn write_be_uint(&mut self, n: uint) {
-        extensions::u64_to_be_bytes(n as u64, uint::bytes, |v| self.write(v))
+        extensions::u64_to_be_bytes(n as u64, uint::BYTES, |v| self.write(v))
     }
 
     /// Write a big-endian int (number of bytes depends on system).
     fn write_be_int(&mut self, n: int) {
-        extensions::u64_to_be_bytes(n as u64, int::bytes, |v| self.write(v))
+        extensions::u64_to_be_bytes(n as u64, int::BYTES, |v| self.write(v))
     }
 
     /// Write a big-endian u64 (8 bytes).