diff --git a/crates/nu-cli/src/line_editor.rs b/crates/nu-cli/src/line_editor.rs index 6cce2cff7..c0d7539eb 100644 --- a/crates/nu-cli/src/line_editor.rs +++ b/crates/nu-cli/src/line_editor.rs @@ -247,7 +247,7 @@ pub fn rustyline_hinter( ) -> Option { if let Some(line_editor_vars) = config.var("line_editor") { for (idx, value) in line_editor_vars.row_entries() { - if idx == "show_hints" && value.expect_string() == "false" { + if idx == "show_hints" && value.as_bool() == Ok(false) { return None; } } diff --git a/crates/nu-cli/src/shell.rs b/crates/nu-cli/src/shell.rs index 0371abe8f..ce7ef7a3a 100644 --- a/crates/nu-cli/src/shell.rs +++ b/crates/nu-cli/src/shell.rs @@ -90,7 +90,10 @@ impl rustyline::completion::Completer for Helper { impl rustyline::hint::Hinter for Helper { type Hint = String; fn hint(&self, line: &str, pos: usize, ctx: &rustyline::Context<'_>) -> Option { - self.hinter.as_ref().and_then(|h| h.hint(line, pos, ctx)) + match &self.hinter { + Some(the_hinter) => the_hinter.hint(line, pos, ctx), + None => Some("".to_string()), + } } }