From 2b28408eae2b3c43a9e88d701e57fc50cd25fad7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Feb 2023 12:30:30 +0000 Subject: [PATCH] chore(deps): bump rustyline from 10.1.1 to 11.0.0 (#16517) * chore(deps): bump rustyline from 10.1.1 to 11.0.0 Bumps [rustyline](https://github.com/kkawakam/rustyline) from 10.1.1 to 11.0.0. - [Release notes](https://github.com/kkawakam/rustyline/releases) - [Changelog](https://github.com/kkawakam/rustyline/blob/master/History.md) - [Commits](https://github.com/kkawakam/rustyline/compare/v10.1.1...v11.0.0) --- updated-dependencies: - dependency-name: rustyline dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Update rustyline by specifying an in memory history manager Signed-off-by: Stephen Wakely --------- Signed-off-by: dependabot[bot] Signed-off-by: Stephen Wakely Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Stephen Wakely --- Cargo.lock | 30 +++--------------------------- lib/vrl/cli/Cargo.toml | 2 +- lib/vrl/cli/src/repl.rs | 5 +++-- 3 files changed, 7 insertions(+), 30 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 68e3414bd2ac4..d0303611c0a43 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3069,17 +3069,6 @@ dependencies = [ "instant", ] -[[package]] -name = "fd-lock" -version = "3.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb21c69b9fea5e15dbc1049e4b77145dd0ba1c84019c488102de0dc4ea4b0a27" -dependencies = [ - "cfg-if", - "rustix 0.36.4", - "windows-sys 0.42.0", -] - [[package]] name = "file-source" version = "0.1.0" @@ -5162,18 +5151,6 @@ dependencies = [ "memoffset 0.6.5", ] -[[package]] -name = "nix" -version = "0.25.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f346ff70e7dbfd675fe90590b92d59ef2de15a8779ae305ebcbfd3f0caf59be4" -dependencies = [ - "autocfg", - "bitflags", - "cfg-if", - "libc", -] - [[package]] name = "nix" version = "0.26.2" @@ -7036,18 +7013,17 @@ dependencies = [ [[package]] name = "rustyline" -version = "10.1.1" +version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e83c32c3f3c33b08496e0d1df9ea8c64d39adb8eb36a1ebb1440c690697aef" +checksum = "5dfc8644681285d1fb67a467fb3021bfea306b99b4146b166a1fe3ada965eece" dependencies = [ "bitflags", "cfg-if", "clipboard-win", - "fd-lock", "libc", "log", "memchr", - "nix 0.25.1", + "nix 0.26.2", "scopeguard", "unicode-segmentation", "unicode-width", diff --git a/lib/vrl/cli/Cargo.toml b/lib/vrl/cli/Cargo.toml index 77dad507735db..f8787de477ea0 100644 --- a/lib/vrl/cli/Cargo.toml +++ b/lib/vrl/cli/Cargo.toml @@ -17,7 +17,7 @@ indoc = "2.0.0" once_cell = { version = "1.17", optional = true } prettytable-rs = { version = "0.10", default-features = false, optional = true } regex = { version = "1", default-features = false, optional = true, features = ["perf"] } -rustyline = { version = "10", default-features = false, optional = true } +rustyline = { version = "11", default-features = false, optional = true } serde_json = "1" thiserror = "1" vector-common = { path = "../../vector-common", default-features = false } diff --git a/lib/vrl/cli/src/repl.rs b/lib/vrl/cli/src/repl.rs index cf1e03b3abf2c..8267ba7f521ab 100644 --- a/lib/vrl/cli/src/repl.rs +++ b/lib/vrl/cli/src/repl.rs @@ -12,6 +12,7 @@ use rustyline::{ error::ReadlineError, highlight::{Highlighter, MatchingBracketHighlighter}, hint::{Hinter, HistoryHinter}, + history::MemHistory, validate::{self, ValidationResult, Validator}, Context, Editor, Helper, }; @@ -61,7 +62,7 @@ pub(crate) fn run( let mut state = TypeState::default(); let mut rt = Runtime::new(state::Runtime::default()); - let mut rl = Editor::::new()?; + let mut rl = Editor::::new()?; rl.set_helper(Some(Repl::new())); #[allow(clippy::print_stdout)] @@ -83,7 +84,7 @@ pub(crate) fn run( // Capture "help docs " Ok(line) if func_docs_regex.is_match(line) => show_func_docs(line, &func_docs_regex), Ok(line) => { - rl.add_history_entry(line); + rl.add_history_entry(line)?; let command = match line { "next" => {