diff --git a/crates/nu-cli/src/completion/mod.rs b/crates/nu-cli/src/completion/mod.rs index 24197e194..74953df6d 100644 --- a/crates/nu-cli/src/completion/mod.rs +++ b/crates/nu-cli/src/completion/mod.rs @@ -13,11 +13,11 @@ pub struct Suggestion { pub replacement: String, } -pub struct Context<'a>(&'a context::Context, &'a rustyline::Context<'a>); +pub struct Context<'a>(&'a context::Context); impl<'a> Context<'a> { - pub fn new(a: &'a context::Context, b: &'a rustyline::Context<'a>) -> Context<'a> { - Context(a, b) + pub fn new(a: &'a context::Context) -> Context<'a> { + Context(a) } } @@ -27,12 +27,6 @@ impl<'a> AsRef for Context<'a> { } } -impl<'a> AsRef> for Context<'a> { - fn as_ref(&self) -> &rustyline::Context<'a> { - self.1 - } -} - pub trait Completer { fn complete( &self, diff --git a/crates/nu-cli/src/shell/helper.rs b/crates/nu-cli/src/shell/helper.rs index 37b51b31e..d0af32d8f 100644 --- a/crates/nu-cli/src/shell/helper.rs +++ b/crates/nu-cli/src/shell/helper.rs @@ -45,9 +45,9 @@ impl rustyline::completion::Completer for Helper { &self, line: &str, pos: usize, - ctx: &rustyline::Context<'_>, + _ctx: &rustyline::Context<'_>, ) -> Result<(usize, Vec), rustyline::error::ReadlineError> { - let ctx = completion::Context::new(&self.context, ctx); + let ctx = completion::Context::new(&self.context); Ok(self.completer.complete(line, pos, &ctx)) } }