]> git.lizzy.rs Git - rust.git/commitdiff
std::io: Use re-exported pathes in examples.
authorOGINO Masanori <masanori.ogino@gmail.com>
Thu, 26 Jun 2014 20:22:26 +0000 (05:22 +0900)
committerOGINO Masanori <masanori.ogino@gmail.com>
Thu, 26 Jun 2014 22:10:33 +0000 (07:10 +0900)
We use re-exported pathes (e.g. std::io::Command) and original ones
(e.g. std::io::process::Command) together in examples now. Using
re-exported ones consistently avoids confusion.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
src/libstd/io/mod.rs
src/libstd/io/net/tcp.rs
src/libstd/io/process.rs
src/libstd/io/timer.rs

index 1d6ad7c31e2fd5ff29c3ce7501ed057658b41411..8014759c88ab0c3c239b51323d1ad1c8e13ff1c9 100644 (file)
@@ -83,7 +83,7 @@
 
     ```rust
     # #![allow(unused_must_use)]
-    use std::io::net::tcp::TcpStream;
+    use std::io::TcpStream;
 
     # // connection doesn't fail if a server is running on 8080
     # // locally, we still want to be type checking this code, so lets
index 7d6ab9d7419b941d0d717e5f66b94ba4903ac50d..b79e831ff61356e491d2d0174dc8eb5521581c88 100644 (file)
@@ -41,7 +41,7 @@
 ///
 /// ```no_run
 /// # #![allow(unused_must_use)]
-/// use std::io::net::tcp::TcpStream;
+/// use std::io::TcpStream;
 ///
 /// let mut stream = TcpStream::connect("127.0.0.1", 34254);
 ///
@@ -162,7 +162,7 @@ pub fn set_keepalive(&mut self, delay_in_seconds: Option<uint>) -> IoResult<()>
     /// ```no_run
     /// # #![allow(unused_must_use)]
     /// use std::io::timer;
-    /// use std::io::net::tcp::TcpStream;
+    /// use std::io::TcpStream;
     ///
     /// let mut stream = TcpStream::connect("127.0.0.1", 34254).unwrap();
     /// let stream2 = stream.clone();
@@ -406,7 +406,7 @@ impl TcpAcceptor {
     ///
     /// ```no_run
     /// # #![allow(experimental)]
-    /// use std::io::net::tcp::TcpListener;
+    /// use std::io::TcpListener;
     /// use std::io::{Listener, Acceptor, TimedOut};
     ///
     /// let mut a = TcpListener::bind("127.0.0.1", 8482).listen().unwrap();
index ecd6693990c437ae12c8d27d94b80dd52b28ecb0..8e1747146e42eb31b9048b4d1daed112f13492f0 100644 (file)
@@ -476,8 +476,8 @@ pub fn wait(&mut self) -> IoResult<ProcessExit> {
     ///
     /// ```no_run
     /// # #![allow(experimental)]
-    /// use std::io::process::{Command, ProcessExit};
-    /// use std::io::IoResult;
+    /// use std::io::{Command, IoResult};
+    /// use std::io::process::ProcessExit;
     ///
     /// fn run_gracefully(prog: &str) -> IoResult<ProcessExit> {
     ///     let mut p = try!(Command::new("long-running-process").spawn());
index 9ae855536acbdeb3688c29ad1b49b5e1b919b260..432461c46063493f4e471d5b42fb29bb0b1d2f07 100644 (file)
@@ -110,7 +110,7 @@ pub fn sleep(&mut self, msecs: u64) {
     /// # Example
     ///
     /// ```rust
-    /// use std::io::timer::Timer;
+    /// use std::io::Timer;
     ///
     /// let mut timer = Timer::new().unwrap();
     /// let ten_milliseconds = timer.oneshot(10);
@@ -122,7 +122,7 @@ pub fn sleep(&mut self, msecs: u64) {
     /// ```
     ///
     /// ```rust
-    /// use std::io::timer::Timer;
+    /// use std::io::Timer;
     ///
     /// // Incorrect, method chaining-style:
     /// let mut five_ms = Timer::new().unwrap().oneshot(5);
@@ -152,7 +152,7 @@ pub fn oneshot(&mut self, msecs: u64) -> Receiver<()> {
     /// # Example
     ///
     /// ```rust
-    /// use std::io::timer::Timer;
+    /// use std::io::Timer;
     ///
     /// let mut timer = Timer::new().unwrap();
     /// let ten_milliseconds = timer.periodic(10);
@@ -170,7 +170,7 @@ pub fn oneshot(&mut self, msecs: u64) -> Receiver<()> {
     /// ```
     ///
     /// ```rust
-    /// use std::io::timer::Timer;
+    /// use std::io::Timer;
     ///
     /// // Incorrect, method chaining-style.
     /// let mut five_ms = Timer::new().unwrap().periodic(5);