Skip to content

Commit 49798a3

Browse files
committed
Fix repl example: Remove indirection, return Result from main()
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
1 parent af59889 commit 49798a3

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

examples/repl.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fn ed_session() -> Result<PtyReplSession, Error> {
2525
Ok(ed)
2626
}
2727

28-
fn do_ed_repl() -> Result<(), Error> {
28+
fn main() -> Result<(), Error> {
2929
let mut ed = ed_session()?;
3030
ed.send_line("a")?;
3131
ed.send_line("ed is the best editor evar")?;
@@ -37,7 +37,3 @@ fn do_ed_repl() -> Result<(), Error> {
3737
ed.exp_eof()?;
3838
Ok(())
3939
}
40-
41-
fn main() {
42-
do_ed_repl().unwrap_or_else(|e| panic!("ed session failed with {}", e));
43-
}

0 commit comments

Comments
 (0)