Skip to content

Commit

Permalink
std::io: Use re-exported pathes in examples.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
omasanori committed Jun 26, 2014
1 parent b20f968 commit dfef422
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/libstd/io/mod.rs
Expand Up @@ -83,7 +83,7 @@ Some examples of obvious things you might want to do
```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
Expand Down
6 changes: 3 additions & 3 deletions src/libstd/io/net/tcp.rs
Expand Up @@ -41,7 +41,7 @@ use rt::rtio;
///
/// ```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);
///
Expand Down Expand Up @@ -162,7 +162,7 @@ impl TcpStream {
/// ```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();
Expand Down Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/io/process.rs
Expand Up @@ -476,8 +476,8 @@ impl Process {
///
/// ```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());
Expand Down
8 changes: 4 additions & 4 deletions src/libstd/io/timer.rs
Expand Up @@ -110,7 +110,7 @@ impl Timer {
/// # Example
///
/// ```rust
/// use std::io::timer::Timer;
/// use std::io::Timer;
///
/// let mut timer = Timer::new().unwrap();
/// let ten_milliseconds = timer.oneshot(10);
Expand All @@ -122,7 +122,7 @@ impl Timer {
/// ```
///
/// ```rust
/// use std::io::timer::Timer;
/// use std::io::Timer;
///
/// // Incorrect, method chaining-style:
/// let mut five_ms = Timer::new().unwrap().oneshot(5);
Expand Down Expand Up @@ -152,7 +152,7 @@ impl Timer {
/// # Example
///
/// ```rust
/// use std::io::timer::Timer;
/// use std::io::Timer;
///
/// let mut timer = Timer::new().unwrap();
/// let ten_milliseconds = timer.periodic(10);
Expand All @@ -170,7 +170,7 @@ impl Timer {
/// ```
///
/// ```rust
/// use std::io::timer::Timer;
/// use std::io::Timer;
///
/// // Incorrect, method chaining-style.
/// let mut five_ms = Timer::new().unwrap().periodic(5);
Expand Down

5 comments on commit dfef422

@bors
Copy link
Contributor

@bors bors commented on dfef422 Jun 27, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on dfef422 Jun 27, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging omasanori/rust/use-reexported = dfef422 into auto

@bors
Copy link
Contributor

@bors bors commented on dfef422 Jun 27, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

omasanori/rust/use-reexported = dfef422 merged ok, testing candidate = deb6b04

@bors
Copy link
Contributor

@bors bors commented on dfef422 Jun 27, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = deb6b04

Please sign in to comment.