mirror of
https://github.com/nushell/reedline.git
synced 2024-09-11 15:55:50 +03:00
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:
parent
bc18ba3260
commit
0216c84aa2
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user