about summary refs log tree commit diff
path: root/src/libstd/rt/io
diff options
context:
space:
mode:
authorPhilipp Brüschweiler <blei42@gmail.com>2013-06-04 12:03:58 +0200
committerPhilipp Brüschweiler <blei42@gmail.com>2013-06-04 12:03:58 +0200
commit34ee63e93bd763326e676bd634f6f17a8f77791d (patch)
tree844bf025d2763daf4913cd7ae965803c20e0e2a3 /src/libstd/rt/io
parent133d45171564c8b7de14523c9f3aa87140b9f043 (diff)
downloadrust-34ee63e93bd763326e676bd634f6f17a8f77791d.tar.gz
rust-34ee63e93bd763326e676bd634f6f17a8f77791d.zip
std::cell: Modernize constructors
Part of #3853
Diffstat (limited to 'src/libstd/rt/io')
-rw-r--r--src/libstd/rt/io/extensions.rs14
-rw-r--r--src/libstd/rt/io/net/tcp.rs4
2 files changed, 9 insertions, 9 deletions
diff --git a/src/libstd/rt/io/extensions.rs b/src/libstd/rt/io/extensions.rs
index fcbf31e87f2..7d6d89ce997 100644
--- a/src/libstd/rt/io/extensions.rs
+++ b/src/libstd/rt/io/extensions.rs
@@ -604,7 +604,7 @@ mod test {
     #[test]
     fn read_byte_0_bytes() {
         let mut reader = MockReader::new();
-        let count = Cell(0);
+        let count = Cell::new(0);
         reader.read = |buf| {
             do count.with_mut_ref |count| {
                 if *count == 0 {
@@ -652,7 +652,7 @@ mod test {
     #[test]
     fn read_bytes_partial() {
         let mut reader = MockReader::new();
-        let count = Cell(0);
+        let count = Cell::new(0);
         reader.read = |buf| {
             do count.with_mut_ref |count| {
                 if *count == 0 {
@@ -691,7 +691,7 @@ mod test {
     #[test]
     fn push_bytes_partial() {
         let mut reader = MockReader::new();
-        let count = Cell(0);
+        let count = Cell::new(0);
         reader.read = |buf| {
             do count.with_mut_ref |count| {
                 if *count == 0 {
@@ -725,7 +725,7 @@ mod test {
     #[test]
     fn push_bytes_error() {
         let mut reader = MockReader::new();
-        let count = Cell(0);
+        let count = Cell::new(0);
         reader.read = |buf| {
             do count.with_mut_ref |count| {
                 if *count == 0 {
@@ -754,7 +754,7 @@ mod test {
         // push_bytes unsafely sets the vector length. This is testing that
         // upon failure the length is reset correctly.
         let mut reader = MockReader::new();
-        let count = Cell(0);
+        let count = Cell::new(0);
         reader.read = |buf| {
             do count.with_mut_ref |count| {
                 if *count == 0 {
@@ -779,7 +779,7 @@ mod test {
     #[test]
     fn read_to_end() {
         let mut reader = MockReader::new();
-        let count = Cell(0);
+        let count = Cell::new(0);
         reader.read = |buf| {
             do count.with_mut_ref |count| {
                 if *count == 0 {
@@ -806,7 +806,7 @@ mod test {
     #[ignore(cfg(windows))]
     fn read_to_end_error() {
         let mut reader = MockReader::new();
-        let count = Cell(0);
+        let count = Cell::new(0);
         reader.read = |buf| {
             do count.with_mut_ref |count| {
                 if *count == 0 {
diff --git a/src/libstd/rt/io/net/tcp.rs b/src/libstd/rt/io/net/tcp.rs
index f7c03c13a58..3607f781da3 100644
--- a/src/libstd/rt/io/net/tcp.rs
+++ b/src/libstd/rt/io/net/tcp.rs
@@ -287,7 +287,7 @@ mod test {
             do spawntask_immediately {
                 let mut listener = TcpListener::bind(addr);
                 for int::range(0, MAX) |i| {
-                    let stream = Cell(listener.accept());
+                    let stream = Cell::new(listener.accept());
                     rtdebug!("accepted");
                     // Start another task to handle the connection
                     do spawntask_immediately {
@@ -326,7 +326,7 @@ mod test {
             do spawntask_immediately {
                 let mut listener = TcpListener::bind(addr);
                 for int::range(0, MAX) |_| {
-                    let stream = Cell(listener.accept());
+                    let stream = Cell::new(listener.accept());
                     rtdebug!("accepted");
                     // Start another task to handle the connection
                     do spawntask_later {