-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Candidate for str #447
Conversation
Should fix kkawakam#443
How exactly am I expected to provide a vector of |
Please provide a minimal example that should but doesn't work. |
impl Completer for LineHelper {
type Candidate = &'static str;
fn complete(
&self,
_line: &str,
_pos: usize,
_ctx: &rustyline::Context<'_>,
) -> rustyline::Result<(usize, Vec<Self::Candidate>)> {
Ok((0, vec!["test1", "test2"]))
}
} |
|
Exactly, and then I can't return a The issue is that |
You are right. impl Candidate for &'static str {
fn display(&self) -> &str {
self
}
fn replacement(&self) -> &str {
self
}
} |
I believe it was because you (or someone) raised concerns about only supporting |
No, we can still patch v8 and provide an impl for |
I meant supporting other lifetimes would mean v9, so yeah, supporting static can be done here. |
Should fix #443