From a4a1a32a42150d3a3fae868c3ce1d7ef4ec40dcb Mon Sep 17 00:00:00 2001 From: Bobbin Threadbare Date: Wed, 19 Jul 2023 23:38:59 -0700 Subject: [PATCH] chore: update rustyline dependency to v12.0 --- miden/Cargo.toml | 2 +- miden/src/cli/debug/mod.rs | 4 ++-- miden/src/repl/mod.rs | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/miden/Cargo.toml b/miden/Cargo.toml index a5127dcce0..121d02cc4e 100644 --- a/miden/Cargo.toml +++ b/miden/Cargo.toml @@ -49,7 +49,7 @@ hex = { version = "0.4", optional = true } log = { version = "0.4", default-features = false } processor = { package = "miden-processor", path = "../processor", version = "0.7", default-features = false } prover = { package = "miden-prover", path = "../prover", version = "0.7", default-features = false } -rustyline = { version = "10.0.0", default-features = false, optional = true} +rustyline = { version = "12.0", default-features = false, optional = true } serde = {version = "1.0.117", optional = true } serde_derive = {version = "1.0.117", optional = true } serde_json = {version = "1.0.59", optional = true } diff --git a/miden/src/cli/debug/mod.rs b/miden/src/cli/debug/mod.rs index 03f2536b4f..ba588643a2 100644 --- a/miden/src/cli/debug/mod.rs +++ b/miden/src/cli/debug/mod.rs @@ -1,5 +1,5 @@ use super::data::{Debug, InputFile, Libraries, ProgramFile}; -use rustyline::{error::ReadlineError, Config, EditMode, Editor}; +use rustyline::{error::ReadlineError, Config, DefaultEditor, EditMode}; use std::path::PathBuf; use structopt::StructOpt; @@ -60,7 +60,7 @@ impl DebugCmd { // initialize readline let mut rl = - Editor::<()>::with_config(rl_config).expect("Readline couldn't be initialized"); + DefaultEditor::with_config(rl_config).expect("Readline couldn't be initialized"); println!("Welcome! Enter `h` for help."); diff --git a/miden/src/repl/mod.rs b/miden/src/repl/mod.rs index 23ce5feb31..f210065cf5 100644 --- a/miden/src/repl/mod.rs +++ b/miden/src/repl/mod.rs @@ -3,7 +3,7 @@ use miden::{ math::{Felt, StarkField}, MemAdviceProvider, StackInputs, Word, }; -use rustyline::{error::ReadlineError, Editor}; +use rustyline::{error::ReadlineError, DefaultEditor}; /// This work is in continuation to the amazing work done by team `Scribe` /// [here](https://github.com/ControlCplusControlV/Scribe/blob/main/transpiler/src/repl.rs#L8) @@ -140,7 +140,7 @@ pub fn start_repl() { let mut memory: Vec<(u64, Word)> = Vec::new(); // initializing readline. - let mut rl = Editor::<()>::new().expect("Readline couldn't be initialized"); + let mut rl = DefaultEditor::new().expect("Readline couldn't be initialized"); loop { let program = format!( "begin\n{}\nend", @@ -232,7 +232,7 @@ pub fn start_repl() { } else if line == "!stack" { should_print_stack = true; } else { - rl.add_history_entry(line.clone()); + rl.add_history_entry(line.clone()).expect("Failed to add a history entry"); program_lines.push(line.clone()); should_print_stack = true; }