Skip to content

Commit ba2fb22

Browse files
committed
minor documentation cleanup
Sets the version in README to 0.5 and removes the unneeded `export crate` from the docs and examples. Signed-off-by: Petre Eftime <petre.eftime@gmail.com>
1 parent 69171fa commit ba2fb22

File tree

8 files changed

+4
-23
lines changed

8 files changed

+4
-23
lines changed

README.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,14 @@ Add this to your `Cargo.toml`
2828

2929
```toml
3030
[dependencies]
31-
rexpect = "0.4"
31+
rexpect = "0.5"
3232
```
3333

3434
Simple example for interacting via ftp:
3535

3636
```rust
37-
extern crate rexpect;
38-
3937
use rexpect::spawn;
40-
use rexpect::errors::*;
38+
use rexpect::error::*;
4139

4240
fn do_ftp() -> Result<()> {
4341
let mut p = spawn("ftp speedtest.tele2.net", Some(30_000))?;
@@ -63,9 +61,8 @@ fn main() {
6361
### Example with bash and reading from programs
6462

6563
```rust
66-
extern crate rexpect;
6764
use rexpect::spawn_bash;
68-
use rexpect::errors::*;
65+
use rexpect::error::*;
6966

7067
fn do_bash() -> Result<()> {
7168
let mut p = spawn_bash(Some(2000))?;
@@ -114,9 +111,8 @@ goes into nirvana. There are two functions to ensure that:
114111

115112

116113
```rust
117-
extern crate rexpect;
118114
use rexpect::spawn_bash;
119-
use rexpect::errors::*;
115+
use rexpect::error::*;
120116

121117
fn do_bash_jobcontrol() -> Result<()> {
122118
let mut p = spawn_bash(Some(1000))?;
@@ -151,7 +147,6 @@ rust stable, beta and nightly on both Linux or Mac.
151147

152148
## Design decisions
153149

154-
- use error handling of [error-chain](https://github.com/brson/error-chain)
155150
- use [nix](https://github.com/nix-rust/nix) (and avoid libc wherever possible)
156151
to keep the code safe and clean
157152
- sadly, `expect` is used in rust too prominently to unwrap `Option`s and

examples/bash.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate rexpect;
21
use rexpect::error::Error;
32
use rexpect::spawn_bash;
43

examples/bash_read.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate rexpect;
21
use rexpect::error::Error;
32
use rexpect::spawn_bash;
43

examples/exit_code.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
extern crate rexpect;
2-
31
use rexpect::error::Error;
42
use rexpect::process::wait;
53
use rexpect::spawn;

examples/ftp.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
extern crate rexpect;
2-
31
use rexpect::error::Error;
42
use rexpect::spawn;
53

examples/repl.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//! An example how you would test your own repl
22
3-
extern crate rexpect;
4-
53
use rexpect::error::Error;
64
use rexpect::session::PtyReplSession;
75
use rexpect::spawn;

src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
//! # Basic example
1616
//!
1717
//! ```no_run
18-
//! extern crate rexpect;
1918
//!
2019
//! use rexpect::spawn;
2120
//! use rexpect::error::Error;
@@ -47,7 +46,6 @@
4746
//! printed "above" the last `execute()`.
4847
//!
4948
//! ```no_run
50-
//! extern crate rexpect;
5149
//! use rexpect::spawn_bash;
5250
//! use rexpect::error::Error;
5351
//!

src/process.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ use std::{thread, time};
2929
/// # #![allow(unused_mut)]
3030
/// # #![allow(unused_variables)]
3131
///
32-
/// extern crate nix;
33-
/// extern crate rexpect;
34-
///
3532
/// use rexpect::process::PtyProcess;
3633
/// use std::process::Command;
3734
/// use std::fs::File;
@@ -151,7 +148,6 @@ impl PtyProcess {
151148
/// # Example
152149
/// ```rust,no_run
153150
///
154-
/// # extern crate rexpect;
155151
/// use rexpect::process::{self, wait::WaitStatus};
156152
/// use std::process::Command;
157153
///

0 commit comments

Comments
 (0)