update readline.rs version
This commit is contained in:
@@ -761,9 +761,9 @@ fn term_to_toplevel<'a, R>(term_stream: &mut TermStream<'a, R>, code_dir: &mut C
|
||||
}
|
||||
|
||||
pub
|
||||
fn string_to_toplevel(buffer: String, wam: &mut Machine) -> Result<TopLevelPacket, SessionError>
|
||||
fn string_to_toplevel<R: Read>(buffer: R, wam: &mut Machine) -> Result<TopLevelPacket, SessionError>
|
||||
{
|
||||
let mut term_stream = TermStream::new(buffer.as_bytes(), wam.indices.atom_tbl(),
|
||||
let mut term_stream = TermStream::new(buffer, wam.indices.atom_tbl(),
|
||||
wam.machine_flags(), &mut wam.indices,
|
||||
&mut wam.policies, &mut wam.code_repo);
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ pub enum Input {
|
||||
Quit,
|
||||
Clear,
|
||||
Batch,
|
||||
TermString(String)
|
||||
TermString(&'static str)
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
@@ -107,9 +107,9 @@ pub fn readline_initialize() {
|
||||
bind_keyseq_rl("\\C-d", bind_end_chord);
|
||||
}
|
||||
|
||||
pub fn read_line(prompt: &str) -> Result<String, SessionError> {
|
||||
pub fn read_line(prompt: &str) -> Result<&'static str, SessionError> {
|
||||
match readline_rl(prompt) {
|
||||
Some(input) => Ok(input.to_string()),
|
||||
Some(input) => Ok(input),
|
||||
None => Err(SessionError::UserPrompt)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user