Fix the first example so it can be run (#371)

The example in the read me doesn't actually run until you add a return value for propagating io results.
This commit is contained in:
Waleed Dahshan 2022-03-29 22:21:54 +11:00 committed by GitHub
parent bc18ba3260
commit 0216c84aa2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,8 +36,9 @@ For the full documentation visit <https://docs.rs/reedline>. The examples should
// Create a default reedline object to handle user input
use reedline::{DefaultPrompt, Reedline, Signal};
use std::io;
fn main() {
fn main() -> io::Result<()> {
let mut line_editor = Reedline::create()?;
let prompt = DefaultPrompt::default();
@ -49,7 +50,7 @@ fn main() {
}
Signal::CtrlD | Signal::CtrlC => {
println!("\nAborted!");
break;
break Ok(());
}
Signal::CtrlL => {
line_editor.clear_screen().unwrap();