Skip to content

Commit e374375

Browse files
committed
Fix bash_read example: Remove indirection, return Result from main()
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
1 parent 4d3efcd commit e374375

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

examples/bash_read.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ extern crate rexpect;
22
use rexpect::error::Error;
33
use rexpect::spawn_bash;
44

5-
fn run() -> Result<(), Error> {
5+
fn main() -> Result<(), Error> {
66
let mut p = spawn_bash(Some(2000))?;
77

88
// case 1: wait until program is done
@@ -33,7 +33,3 @@ fn run() -> Result<(), Error> {
3333
p.send_control('c')?;
3434
Ok(())
3535
}
36-
37-
fn main() {
38-
run().unwrap_or_else(|e| panic!("bash process failed with {}", e));
39-
}

0 commit comments

Comments
 (0)