diff options
Diffstat (limited to 'cli')
-rw-r--r-- | cli/tools/repl.rs | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/cli/tools/repl.rs b/cli/tools/repl.rs index 8e3df4109..73d1688e5 100644 --- a/cli/tools/repl.rs +++ b/cli/tools/repl.rs @@ -37,7 +37,6 @@ struct Helper { context_id: u64, message_tx: SyncSender<(String, Option<Value>)>, response_rx: Receiver<Result<Value, AnyError>>, - highlighter: LineHighlighter, } impl Helper { @@ -183,32 +182,18 @@ impl Highlighter for Helper { hint.into() } - fn highlight<'l>(&self, line: &'l str, pos: usize) -> Cow<'l, str> { - self.highlighter.highlight(line, pos) - } - fn highlight_candidate<'c>( &self, candidate: &'c str, _completion: rustyline::CompletionType, ) -> Cow<'c, str> { - self.highlighter.highlight(candidate, 0) + self.highlight(candidate, 0) } fn highlight_char(&self, line: &str, _: usize) -> bool { !line.is_empty() } -} - -struct LineHighlighter; - -impl LineHighlighter { - fn new() -> Self { - Self - } -} -impl Highlighter for LineHighlighter { fn highlight<'l>(&self, line: &'l str, _: usize) -> Cow<'l, str> { let mut out_line = String::from(line); @@ -436,7 +421,6 @@ pub async fn run( context_id, message_tx, response_rx, - highlighter: LineHighlighter::new(), }; let editor = Arc::new(Mutex::new(Editor::new())); |