fn readline_loop<F>(rl: &mut rustyline::Editor<()>, prompt: &str, mut f: F) -> Result<()>
    where F: FnMut(&mut rustyline::Editor<()>, &str)
{
    loop {
        match rl.readline(prompt) {
            Ok(line) => {
                rl.add_history_entry(&line);
                f(rl, &line);
            }
            Err(ReadlineError::Eof) => break,
            Err(e) => Err(e)?,
        }
    }

    Ok(())
}
/// Repeatedly calls `f`, passing in each line, using the given promt, until EOF is received
Repeatedly calls `f`, passing in each line, using the given promt, until EOF is received
Repeatedly calls ` f ` passing in each line using the given promt until EOF is received
fn readline_loop<F>(rl: &mut rustyline::Editor<()>, prompt: &str, mut f: F) -> Result<()>
    where F: FnMut(&mut rustyline::Editor<()>, &str)
{
    loop {
        match rl.readline(prompt) {
            Ok(line) => {
                rl.add_history_entry(&line);
                f(rl, &line);
            }
            Err(ReadlineError::Eof) => break,
            Err(e) => Err(e)?,
        }
    }
    Ok(())
}
fn readline_loop < F > ( rl : & mut rustyline :: Editor < ( ) > , prompt : & str , mut f : F ) -> Result < ( ) > where F : FnMut ( & mut rustyline :: Editor < ( ) > , & str ) { loop { match rl . readline ( prompt ) { Ok ( line ) => { rl . add_history_entry ( & line ) ; f ( rl , & line ) ; } Err ( ReadlineError :: Eof ) => break , Err ( e ) => Err ( e ) ? , } } Ok ( ( ) ) }
Repeatedly calls `f`, passing in each line, using the given promt, until EOF is received
Repeatedly calls ` f ` passing in each line using the given promt until EOF is received
rl
&mut rustyline::Editor<()>
prompt
&str
f
F